Validating multiple files at once with different data models
Is it possible to validate a package containing multiple XML files that conform to different data models?
Our command line is
java -Xmx12G -cp "/path/to/resolver.jar:/path/to/catalogs:/path/to/saxon.jar" com.saxonica.Validate /path/to/*.xml -config:/path/to/saxon-config-validation.xml -r:org.apache.xml.resolver.tools.CatalogResolver -x:org.apache.xml.resolver.tools.ResolvingXMLReader
The folder contains XML files that declare a DTD (mapped in the catalog) and an XML file that declares a schema (with @xsi:schemaLocation)
We are using Saxon-EE version 18.104.22.168
Updated by Michael Kay over 1 year ago
I think the answer is that it should work provided the schemas are compatible. Saxon maintains a global (Configuration-level) schema (= a set of schema components) and when validation uses
xsi:schemaLocation, the schema components at that location are added to the global pool. If this causes conflicts (two different types with the same name, for example) you'll get an error.
I doubt this is well tested, so if you get a failure, please send us the details so we can try and reproduce it.
Updated by Mark Dunn over 1 year ago
As noted above I was able to validate my package with a later version of Saxon.
The package does not validate against more than one XML schema. Only one data model is a schema but both DTD (JATS 1.2) and schema (a bespoke data model) contain definitions of elements with the same name.
E.g. is common to both data models but has a namespace in the schema.
(So no conflict because the namespace makes it different?)
Please register to edit this issue