Package com.saxonica.schema

This package contains classes used to represent the information in a schema, that is, the schema components.

See: Description

Package com.saxonica.schema Description

This package contains classes used to represent the information in a schema, that is, the schema components. The model is closely related to the schema component model defined in the XSD specifications, but not identical in every respect.

Representing the schema itself is the class PreparedSchema. All the schemas that have been imported into the application are linked from the Configuration object; they thus outlive a single transformation or query. Other important classes have intuitive names, for example ComplexType, SimpleType, ElementDecl, and AttributeDecl.

Schema components in Saxon are always built from schema documents, so the classes representing objects in the schema are constructed using the corresponding classes in the com.saxonica.schema.sdoc package. (There is an exception to this: schema components can also be exported to an SCM file, and subsequently re-imported from this file.)

The schema class obtained by the Configuration.getSuperSchema() method represents the collection of all loaded schemas. There can only be one active collection of schema components for any one namespace. This means it is not possible to use two unrelated no-namespace schemas concurrently, or two different versions of a schema for the same namespace.

Named types, element declarations, and attribute declarations are indexed directly from the NamePool. It is not necessary first to locate the schema in which they are contained, they can be found directly using the namePool fingerprint of their expanded QName.

The schema model retains nearly all the information in the source schema: the notable omission is annotations.

The API for this package is particular to Saxon, though it is influenced by the definition of schema components in the XSD specification. At some time in the future it is possible that it may be replaced by an API conforming to externally-defined standards.

The code in this package was originally derived from Castor, but has been totally rewritten (though traces of the design may still be in evidence).

Michael H. Kay
Saxonica Limited
30 July 2010

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.