-
Notifications
You must be signed in to change notification settings - Fork 20
Description
The specifications (XQuery and XSLT) should say something about the effect of requesting validation on a document that contains xsi:schemaLocation and/or xsi:noNamespaceSchemaLocation attributes. At present XQuery says nothing, and XSLT says very little.
XQuery 3.1 says: A validate expression can be used to validate a document node or an element node with respect to the [in-scope schema definitions], using the schema validation process defined in [[XML Schema 1.0]] or [[XML Schema 1.1]]. This doesn't really answer the question. The "with respect to" phrase could be read as implying that ONLY the in-scope schema definitions are used. Particular problems occur if xsi:schemaLocation refers to a schema document that attempts to override or redefine the schema components that have been statically imported.
XSLT 3.0 says nothing of interest about what schema (=set of schema components) is used when validation is requested, though it does mention in passing that xsi:schemaLocation attributes might be interpreted in some way by a schema processor.
If we look to the behaviour of Saxon as a reference implementation, then we'll quickly find fault. There's a configuration option to control whether xsi:schemaLocation attributes are considered or ignored; if they are considered, then the schema components referenced are added to a global pool of schema components which are used not only to validate the document in question, but to validate any subsequent documents. We're in the process of redesigning this to do something that makes more sense.