#998 Unresolved SimpleTypeDefinition in schema

Michael Kay
Michael Kay

During the course of Schema processing, Saxon represents a simple type definition by means of an object of class SimpleTypeDefinition. As soon as it is known whether this is a union, list, or atomic type (which may sometimes not be immediately obvious), this object is replaced by an instance of UserAtomicType, UserListType, or UserUnionType as appropriate. At the end of schema processing, there should be no SimpleTypeDefinitions still unresolved. If there are, then an error message is likely such as "Can't use a SimpleTypeDefinition at run-time" or "SimpleTypeDefinition should have been resolved by now".

This error is occuring in Saxon 9.2 with the official Dutch metadata schemas at http://standaarden.overheid.nl/vac/1.1/xsd/vac.xsd. The problem is caused by a change introduced in 9.2 to handle schemas that use multiple layers of redefinition (A redefines B, and B redefines C). To handle this problem, a redefinitionLevel attribute was added to each schema component, and all references in the schema to a given component name are taken as references to the version with the highest redefinition level.

The problem is that the redefinition level is not being preserved when a SimpleTypeDefinition is replaced by a UserUnionType, UserListType, or UserAtomicType object. This means that in a schema where the variety of a type is not known before it is redefined (for example, when redefining a union type by restricting it), the SimpleTypeDefinition may be retained in the final schema in preference to the specific type that is intended to replace it. The problem is only likely to occur in schemas with complex redefinition structures: in the schema in question, the problem is that a particular component is reachable both by a route that includes "redefines" and also by a route that does not.

A patch is being placed in the (private) Subversion repository for Saxon-EE code, and will appear in the next maintenance release.


  • Michael Kay
    Michael Kay

    Fixed in