Class MinimalSchema

java.lang.Object
net.sf.saxon.type.MinimalSchema
All Implemented Interfaces:
Schema

public class MinimalSchema extends Object implements Schema
A schema that contains only the built-in types. This class is used in Saxon-HE and Saxon-PE, which do not support schema validation.
  • Constructor Details

  • Method Details

    • getConfiguration

      public Configuration getConfiguration()
      Get the configuration
      Specified by:
      getConfiguration in interface Schema
    • includesTargetNamespace

      public boolean includesTargetNamespace(NamespaceUri target)
      Specified by:
      includesTargetNamespace in interface Schema
    • getAttributeDecl

      public IAttributeDecl getAttributeDecl(int fingerprint)
      Get a global attribute declaration by fingerprint
      Specified by:
      getAttributeDecl in interface Schema
      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

      public IAttributeDecl getAttributeDecl(StructuredQName name)
      Get a global attribute declaration by QName
      Specified by:
      getAttributeDecl in interface Schema
      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

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

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

      public SchemaType getSchemaType(StructuredQName name)
      Get the top-level schema type definition with a given QName.
      Specified by:
      getSchemaType in interface Schema
      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

      public 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.

      Specified by:
      getDocumentValidator in interface Schema
      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

      public 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.

      Specified by:
      getElementValidator in interface Schema
      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

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

      This method is intended for internal use.

      Specified by:
      validateAttribute in interface Schema
      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
    • makeSchemaElementTest

      public GNodeType makeSchemaElementTest(int fp) throws SchemaException
      Make a schema-element node test for a given element name
      Specified by:
      makeSchemaElementTest in interface Schema
      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

      public GNodeType makeSchemaAttributeTest(int fp) throws SchemaException
      Make a schema-attribute node test for a given attribute name
      Specified by:
      makeSchemaAttributeTest in interface Schema
      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