Interface Schema

All Known Implementing Classes:
MinimalSchema, PreparedSchema, SingleNamespaceSchema

public interface Schema
A schema is a collection of schema components. It may be derived from a single schema document (an xs:schema element), in which case it contains those components defined in that schema document, the components defined in the included documents (expanded transitively), and the components defined in imported schema documents (not expanded transitively). Alternatively, it may be a collection of schema components derived from multiple independent schema documents.
  • Method Details

    • getConfiguration

      Configuration getConfiguration()
      Get the configuration
    • includesTargetNamespace

      boolean includesTargetNamespace(NamespaceUri target)
    • getAttributeDecl

      IAttributeDecl getAttributeDecl(int fingerprint)
      Get a global attribute declaration by fingerprint
      Parameters:
      fingerprint - the NamePool fingerprint of the element name
      Returns:
      the attribute declaration whose name matches the given fingerprint, or null if no element declaration with this name has been registered.
    • getAttributeDecl

      IAttributeDecl getAttributeDecl(StructuredQName name)
      Get a global attribute declaration by QName
      Parameters:
      name - the the element name
      Returns:
      the attribute declaration whose name matches the given fingerprint, or null if no element declaration with this name has been registered.
    • getElementDecl

      IElementDecl getElementDecl(int fingerprint)
      Get the global element declaration with a given fingerprint
      Parameters:
      fingerprint - the NamePool fingerprint of the name of the element
      Returns:
      the element declaration, or null if not found.
    • getElementDecl

      IElementDecl getElementDecl(StructuredQName name)
      Get the global element declaration with a given name
      Parameters:
      name - the name of the element
      Returns:
      the element declaration, or null if not found.
    • getSchemaType

      SchemaType getSchemaType(StructuredQName name)
      Get the top-level schema type definition with a given QName.
      Parameters:
      name - the name of the required schema type
      Returns:
      the schema type , or null if there is none with this name.
      Since:
      9.7
    • getDocumentValidator

      Receiver getDocumentValidator(Receiver receiver, String systemId, ParseOptions validationOptions, Location initiatingLocation)
      Get a document-level validator to add to a Receiver pipeline.

      This method is intended for internal use.

      Parameters:
      receiver - The receiver to which events should be sent after validation
      systemId - the base URI of the document being validated
      validationOptions - Supplies options relevant to XSD validation
      initiatingLocation - The location of the expression that requested validation
      Returns:
      A Receiver to which events can be sent for validation
    • getElementValidator

      Receiver getElementValidator(Receiver receiver, ParseOptions validationOptions, Location locationId) throws XPathException
      Get a Receiver that can be used to validate an element, and that passes the validated element on to a target receiver. If validation is not supported, the returned receiver will be the target receiver.

      This method is intended for internal use.

      Parameters:
      receiver - the target receiver tp receive the validated element
      validationOptions - options affecting the way XSD validation is done
      locationId - current location in the stylesheet or query
      Returns:
      The target receiver, indicating that with this configuration, no validation is performed.
      Throws:
      XPathException - if a validator for the element cannot be created
    • validateAttribute

      SimpleType validateAttribute(StructuredQName nodeName, UnicodeString value, int validation) throws ValidationException, MissingComponentException
      Validate an attribute value.

      This method is intended for internal use.

      Parameters:
      nodeName - the name of the attribute
      value - the value of the attribute as a string
      validation - STRICT or LAX
      Returns:
      the type annotation to apply to the attribute node
      Throws:
      ValidationException - if the value is invalid
      MissingComponentException
    • makeSchemaElementTest

      GNodeType makeSchemaElementTest(int fp) throws SchemaException
      Make a schema-element node test for a given element name
      Parameters:
      fp - the integer fingerprint of the element name
      Returns:
      a node test corresponding to the XPath item type syntax schema-element(E)
      Throws:
      SchemaException - if there is no element declaration with this name in the schema
    • makeSchemaAttributeTest

      GNodeType makeSchemaAttributeTest(int fp) throws SchemaException
      Make a schema-attribute node test for a given attribute name
      Parameters:
      fp - the integer fingerprint of the attribute name
      Returns:
      a node test corresponding to the XPath item type syntax schema-attribute(E)
      Throws:
      SchemaException - if there is no attribute declaration with this name in the schema