Package net.sf.saxon.type
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 Summary
Modifier and TypeMethodDescriptiongetAttributeDecl(int fingerprint) Get a global attribute declaration by fingerprintGet a global attribute declaration by QNameGet the configurationgetDocumentValidator(Receiver receiver, String systemId, ParseOptions validationOptions, Location initiatingLocation) Get a document-level validator to add to a Receiver pipeline.getElementDecl(int fingerprint) Get the global element declaration with a given fingerprintGet the global element declaration with a given namegetElementValidator(Receiver receiver, ParseOptions validationOptions, Location locationId) Get a Receiver that can be used to validate an element, and that passes the validated element on to a target receiver.getSchemaType(StructuredQName name) Get the top-level schema type definition with a given QName.booleanincludesTargetNamespace(NamespaceUri target) makeSchemaAttributeTest(int fp) Make aschema-attributenode test for a given attribute namemakeSchemaElementTest(int fp) Make aschema-elementnode test for a given element namevalidateAttribute(StructuredQName nodeName, UnicodeString value, int validation) Validate an attribute value.
-
Method Details
-
getConfiguration
Configuration getConfiguration()Get the configuration -
includesTargetNamespace
-
getAttributeDecl
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
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
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
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
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 validationsystemId- the base URI of the document being validatedvalidationOptions- Supplies options relevant to XSD validationinitiatingLocation- 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 elementvalidationOptions- options affecting the way XSD validation is donelocationId- 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 attributevalue- the value of the attribute as a stringvalidation- STRICT or LAX- Returns:
- the type annotation to apply to the attribute node
- Throws:
ValidationException- if the value is invalidMissingComponentException
-
makeSchemaElementTest
Make aschema-elementnode 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
Make aschema-attributenode 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
-