Project

Profile

Help

Support #5729

closed

Validating multiple files at once with different data models

Added by Mark Dunn over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2022-11-07
Due date:
% Done:

0%

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

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

Actions #1

Updated by Mark Dunn over 1 year 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.

Actions #2

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.

Actions #3

Updated by Mark Dunn over 1 year 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?)

Actions #4

Updated by Michael Kay about 1 year ago

  • Status changed from New to Closed

Please register to edit this issue

Also available in: Atom PDF