XML Schema 1.1 implementation

There is a change to the way in which unresolved references to schema components are handled.

The XSD specification (at both XSD 1.0 and 1.1) says that a schema should be treated as valid even though it contains references to missing components (for example, an attribute declaration referring to an xs:simpleType that has not been declared), provided that the missing components are not actually needed for validation. This provision has always been rather unsatisfactory. Saxon has attempted to implement it, but not always successfully. It doesn't help that the W3C conformance tests for XSD expect such schemas to be reported as invalid.

In Saxon 10, by default, schemas containing such dangling references are reported as invalid.

A new configuration option is provided to accept dangling references. In this case the schema compiler outputs a warning, and (where possible) generates a schema in which the dangling references are "repaired".

The repair strategies are as follows:

In earlier releases, when a missing component was detected at run-time (that is, during validation/assessment of a document instance) it was handled by throwing a MissingComponentException.

This exception has now been changed to an unchecked exception, so it does not have such an all-pervasive effect on the code. The result is that we can now attempt to provide more cases where absent components leave the schema usable; but with increased risk that references to components that are needed but absent cause a more severe failure when they occur.