I have an XML file with 14 schemas to validate. All schemas are standalone and don't import each other, nor is there any sort of "super schema" that links all of them...
All the online / downloadable tools I could find ask me to upload my XML file and then provide ONE schema file.
I am just asking, from an XML standard point of view, am I understanding schemas wrong and they all can somehow be used with one file? Again, the different schemas governing my XML file are each specific to their namespace and no inheritance or reuse of other schemas inside schemas.
It's just weird, that even a tool that costs $100 (XmlBluePrint) only lets you use one schema file for validation...
On the other hand, I know java can do:
Schema schema = schemaFactory.newSchema(new Source[] {
new StreamSource(new FileInputStream("main.xsd")),
new StreamSource(new FileInputStream("extension.xsd")),
});
But I am not so confident with Java, maybe I don't understand something?
You are correct on both accounts:
There is no "one schema rule for XML" anywhere in the XML standard: You are allowed to validate an XML document with as many schemas as you'd like.
There is little support by tools for specifying more than one schema for an XML document. Even the xsi:noNamespaceSchemaLocation
and xsi:schemaLocation
hints from the standard only directly support association with a single XSD and a single XSD per namespace, respectively.
Options include writing custom code or manually changing settings.