XML Schema 1.0 implementation

There is a rule in both XSD 1.0 and XSD 1.1 that components redefined using xs:redefine must have been defined immediately within the schema document referenced by the xs:redefine element. Previous releases of Saxon did not enforce this rule, instead allowing the redefined component to be either in the redefined schema document or in an indirectly included schema document. Saxon 9.3 checks the rule, but reports any violations in the form of a warning rather than a hard error, to avoid invalidating schemas that previously worked.

Elements and attributes of type xs:ENTITY or xs:ENTITIES are now checked against the list of unparsed entities declared in the document. (This check is not performed during validation invoked by XSLT or XQuery validation, but it is performed during standalone schema validation.)

There is a new switch FeatureKeys.VALIDATION_COMMENTS to control whether comments are written into an instance document when validation fails. Previously this always happened if the switch FeatureKeys.VALIDATION_WARNINGS was on; it can now be controlled separately, and the default is off. A corresponding switch has been added to the configuration file. The command-line option -outval:recover sets both switches on. Internally the switches are held in the ParseOptions object and can thus be set differently for different validation episodes. For the FeatureKeys.VALIDATION_WARNINGS switch, the two flags previously held in the default ParseOptions and in local Configuration data have been combined into one, preventing the use of inconsistent settings.

Static type checking is now applied to the XPath expressions in the xs:field and xs:selector elements of identity constraints. Warnings are reported if the paths select nothing, or if the field expression potentially selects multiple nodes, an empty sequence (in the case of xs:key only), or nodes whose type is not a simple type or a complex type with simple content.