Package net.sf.saxon.type
Class MinimalSchema
java.lang.Object
net.sf.saxon.type.MinimalSchema
- All Implemented Interfaces:
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 Summary
Constructors -
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.
-
Constructor Details
-
MinimalSchema
-
-
Method Details
-
getConfiguration
Get the configuration- Specified by:
getConfigurationin interfaceSchema
-
includesTargetNamespace
- Specified by:
includesTargetNamespacein interfaceSchema
-
getAttributeDecl
Get a global attribute declaration by fingerprint- Specified by:
getAttributeDeclin interfaceSchema- 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- Specified by:
getAttributeDeclin interfaceSchema- 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- Specified by:
getElementDeclin interfaceSchema- 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- Specified by:
getElementDeclin interfaceSchema- 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.- Specified by:
getSchemaTypein interfaceSchema- 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:
getDocumentValidatorin interfaceSchema- 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
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:
getElementValidatorin interfaceSchema- 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
public SimpleType validateAttribute(StructuredQName nodeName, UnicodeString value, int validation) throws ValidationException Validate an attribute value.This method is intended for internal use.
- Specified by:
validateAttributein interfaceSchema- 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 invalid
-
makeSchemaElementTest
Make aschema-elementnode test for a given element name- Specified by:
makeSchemaElementTestin interfaceSchema- 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- Specified by:
makeSchemaAttributeTestin interfaceSchema- 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
-