Support #5729


Validating multiple files at once with different data models

Added by Mark Dunn 20 days ago. Updated 20 days ago.

Start date:
Due date:
% Done:


Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:


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

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

Actions #1

Updated by Mark Dunn 20 days ago

Correction - this is with version

I've successfully validated my package with so perhaps I was hitting a bug in an older version.

Actions #2

Updated by Michael Kay 20 days 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.

Actions #3

Updated by Mark Dunn 20 days 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

Also available in: Atom PDF