Class XsdSchema

java.lang.Object
net.sf.saxon.s9api.XsdSchema
Direct Known Subclasses:
XsdSchemaImpl

public abstract class XsdSchema extends Object
This class represents an XSD Schema - that is, a set of schema components, typically resulting from compiling a collection of one or more source schema documents.

The class exists in all Saxon editions as an abstract place-holder class, but concrete implementations exist only in Saxon-EE.

  • Constructor Details

    • XsdSchema

      public XsdSchema()
  • Method Details

    • newValidator

      public abstract SchemaValidator newValidator()
      Create a SchemaValidator which can be used to validate instance documents against this schema
      Returns:
      a new SchemaValidator
      Since:
      13.0
    • newItemTypeFactory

      public abstract ItemTypeFactory newItemTypeFactory()
      Create an ItemTypeFactory which can be used to create ItemType objects based on the definitions in this schema.
      Returns:
      an ItemTypeFactory linked to this schema.
    • combine

      public abstract XsdSchema combine(XsdSchema other) throws SaxonApiException
      Combine this schema with another, to form a new combined schema.

      Note: in relatively unusual circumstances, a document that is valid against one of the two input schemas might not be valid against the combined schema. For example, if the first schema has a wildcard with processContents="lax" then an element might be laxly validated when assessed using that schema, but strictly validated when assessed against the combined schema; and strict validation may fail while lax validation succeeded.

      Parameters:
      other - the other schema to combine with this one.
      Returns:
      the combined schema, assuming the two schemas are compatible
      Throws:
      SaxonApiException - if the two schemas cannot be combined, for example because they contain components with duplicated names
      Since:
      13.0
    • getUnderlyingSchema

      public abstract Schema getUnderlyingSchema()
      Get the underlying implementation-level Schema
    • exportComponents

      public abstract void exportComponents(Destination destination) throws SaxonApiException
      Export a precompiled Schema Component Model containing all the components (except built-in components) in this schema.
      Parameters:
      destination - the destination to recieve the precompiled Schema Component Model in the form of an XML document
      Throws:
      SaxonApiException - if a failure occurs writing the schema components to the supplied destination