Support #5729
closed![Author: Mark Dunn](https://www.gravatar.com/avatar/f20c88c4b4702b763f55a8e1abeed9aa?rating=PG&size=50&default=https%3A%2F%2Fassets.plan.io%2Fimages%2Fdefault_avatar.png)
Validating multiple files at once with different data models
0%
Description
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 9.9.1.6
Updated by Mark Dunn almost 2 years ago
Correction - this is with version 9.5.1.4
I've successfully validated my package with 9.9.1.6 so perhaps I was hitting a bug in an older version.
Updated by Michael Kay almost 2 years 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 almost 2 years ago
Thanks Michael.
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