A single XML Schema specification is used in many open standards using different design choices. In this VisualSchema.com blog, along with announcing the availability of a specific standard as a Visual Schema, any design choice specific to the particular standard will be briefly discussed. So far two such choices have been discussed, XML Schema: Is Extensible Value List A Right Design? and Visual Schemas For B2MML.
Here is another issue related to GS1 GDSN. XML Schema standard does not mandate a 1-to-1 relationship between a namespace and it’s location. This is probably good and bad. It’s good because, a large open standard that belongs to a given namespace need not be maintained in a single file. However, it is bad because, looking at a given namespace, it’s not possible to figure out which of the multiple files are needed for a given usage. When importing a namespace, it has to be imported multiple times if there are multiple defining that namespace. The standard assumes that beyond the first location, rest all are just as a hint and mandatory. However, Xerces has an option called honour-all-schemaLocations and only when this is set to true (by default it’s false), it will try loading files from all the imports of a given namespace.
In case of OAGIS, all the multiple files belonging to a namespace are put together using include statements and then this single file is imported. This approach would not require the above honor-multiple-schemaLocations fix. But GS1 GDSN has chosen to import multiple files and this took a bit to figure out how to fix the issue.
So, even though modern parsers and tools are capable of recognizing multiple imports, VisualSchema recommends following the OAGIS approach of putting all the namespace files in another file using include statement and then using this single file where needed using an import statement.
Filed under: XML Schema