Package com.saxonica.ee.schema.sdoc
Class XSDSchema
java.lang.Object
net.sf.saxon.tree.linked.NodeImpl
net.sf.saxon.tree.linked.ParentNodeImpl
net.sf.saxon.tree.linked.ElementImpl
com.saxonica.ee.schema.sdoc.SchemaElement
com.saxonica.ee.schema.sdoc.XSDSchema
- All Implemented Interfaces:
Source
,SourceLocator
,ActiveSource
,GroundedValue
,Item
,MutableNodeInfo
,NamespaceResolver
,NodeInfo
,Sequence
,Location
,SteppingNode
,SiblingCountingNode
,Locator
An xs:schema element in an XML Schema document
-
Nested Class Summary
Nested classes/interfaces inherited from class com.saxonica.ee.schema.sdoc.SchemaElement
SchemaElement.XPathStaticContext
-
Field Summary
Fields inherited from class com.saxonica.ee.schema.sdoc.SchemaElement
NAMESPACE_ANY, NAMESPACE_LOCAL, NAMESPACE_OTHER, NAMESPACE_TARGET, REQUIRE_NULL_NS, REQUIRE_TARGET_NS, USE_DEFAULT_NS, USE_DEFAULT_NS_WITHOUT_IMPORT
Fields inherited from class net.sf.saxon.tree.linked.NodeImpl
NODE_LETTER
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an XSDSchema object, representing the xs:schema element in a schema document -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGlobalParam
(GlobalParam param) Declare a global parameter for XPath expressions in this schema document (Saxon extension)boolean
Ask if the default open content wildcard applies to types that would otherwise have an EMPTY content modelGet the set of extensions allowed in this schema documentReturns the attributeFormDefault property of this Schema.int
Returns the default BlockList for this Schema.Get a reference to the default attribute groupGet the default open content mode, as a string (interleave or suffix)Get the default open content wildcard, if anyReturns the elementFormDefault property of this Schema.int
Get the number of errors detected in this schema documentGet the Executable corresponding to this schema document.int
Returns the default value of "final" for this Schema.Get the GlobalParam object representing a named parameter (Saxon extension)Return the set of global parameters defined in this schema documentGet the PreparedSchema to which schema components are being addedGet the SchemaCompiler in useGet the target namespace of this schema document.Get the value of the defaultXPathDefaultNamespace attribute defined on this elementvoid
Increment the number of errors detected in this schema documentboolean
Determine if this is a chameleon schema document, that is, one with no targetNamespace of its own, whose effective target namespace (and for many purposes, default namespace) are set to the targetNamespace of the referring schema document.protected boolean
isFinalState
(int state) For elements whose content model is parsed using a finite state machine, test whether a given state is a final state.boolean
Determine whether a given URI is that of a namespace that has been imported into this schema document.void
postValidate
(SchemaCompiler compiler) Process child elements after validationprotected void
Validate and process the attributes on this element in the schema documentvoid
setAttributeFormDefault
(String attributeFormDefault) Sets the attributeFormDefault property of this Schema.void
setBlockDefault
(int value) Sets the default Block values for this Schema.void
setDefaultOpenContent
(Wildcard wildcard, String mode, boolean appliesToEmpty) Set the open content wildcard and modevoid
setElementFormDefault
(String elementFormDefault) Sets the elementFormDefault property of this Schema.void
setFinalDefault
(int value) Set the default "final" list for this Schema.void
setReferrer
(SchemaElement referrer) Set the xs:include, xs:import, or xs:redefine element that caused this schema document to be loadedvoid
setSchema
(SingleNamespaceSchema schema) Set the SingleNamespaceSchema to which schema components are being addedvoid
setSchemaCompiler
(SchemaCompiler manager) Set the SchemaCompiler in usevoid
validate
(SchemaCompiler compiler) Validate this schema element, checking all document-level constraintsprotected void
validateChildren
(SchemaCompiler compiler) Validate the children of this node, recursively.Methods inherited from class com.saxonica.ee.schema.sdoc.SchemaElement
allocateAnonymousTypeCode, allowAttributes, checkContentModel, checkLocalTargetNamespace, checkMutuallyExclusiveAttributes, checkOnlyChildIsAnnotation, checkPermittedType, duplicate, duplicateElement, error, error, getComponentName, getContainingComplexType, getContainingSimpleType, getFingerprint, getSchemaNodeFactory, getXSDSchema, illegalElement, indefiniteArticle, invalidAttributeValue, isTopLevel, makeNamespaceContext, missingAttribute, missingChildElement, mustBeFirstElement, mustPrecede, mutuallyExclusive, mutuallyExclusiveAttributes, mutuallyExclusiveElementAndAttribute, parseBooleanAttribute, parseFinalOrBlock, processAllAttributes, processAllowedNamespaces, processDisallowedNamespaces, processDisallowedQNames, processId, processMaxOccurs, processMinOccurs, requireAttribute, setSchemaNodeFactory, validateSubtree, warning
Methods inherited from class net.sf.saxon.tree.linked.ElementImpl
addAttribute, addNamespace, addNamespace, attributes, checkNotNamespaceSensitiveElement, copy, delete, fixupInsertedNamespaces, generateId, getAllNamespaces, getAttributeValue, getBaseURI, getColumnNumber, getDeclaredNamespaces, getLineNumber, getNodeKind, getNodeName, getRoot, getSchemaType, getSystemId, getURIForPrefix, initialise, isId, isIdref, isIdRefNode, isInScopeNamespace, isNilled, iteratePrefixes, removeAttribute, removeNamespace, removeTypeAnnotation, rename, replaceStringValue, setAttributeInfo, setAttributes, setLocation, setNamespaceMap, setNilled, setNodeName, setSystemId, setTypeAnnotation
Methods inherited from class net.sf.saxon.tree.linked.ParentNodeImpl
addChild, compact, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getRawSequenceNumber, getSequenceNumber, getUnicodeStringValue, hasChildNodes, insertChildren, insertChildrenAt, iterateChildren, removeChild, replaceChildrenAt, setChildren, setRawSequenceNumber
Methods inherited from class net.sf.saxon.tree.linked.NodeImpl
atomize, compareOrder, effectiveBooleanValue, equals, getConfiguration, getDisplayName, getFingerprint, getLocalPart, getNamePool, getNamespaceUri, getNextInDocument, getNextSibling, getParent, getPhysicalRoot, getPrefix, getPreviousInDocument, getPreviousSibling, getRawParent, getSiblingPosition, getSuccessorElement, getTreeInfo, hasFingerprint, hashCode, head, insertSiblings, isDeleted, iterateAxis, iterateAxis, newBuilder, replace, saveLocation, setRawParent, setSiblingPosition
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, itemAt, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.om.NodeInfo
asActiveSource, children, children, deliver, getAttributeValue, getGenre, getPublicId, getURI, isSameNodeInfo, isStreamed, toShortString
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
XSDSchema
public XSDSchema()Create an XSDSchema object, representing the xs:schema element in a schema document
-
-
Method Details
-
getSchema
Get the PreparedSchema to which schema components are being added- Overrides:
getSchema
in classSchemaElement
- Returns:
- the PreparedSchema containing the compiled schema components
-
getExecutable
Get the Executable corresponding to this schema document. This is a container for the XPath expressions it contains.- Returns:
- the Executable for XPath expressions
-
getAllowedExtensions
Get the set of extensions allowed in this schema document- Returns:
- the set of allowed extensions (from the saxon:extensions attribute)
-
setSchema
Set the SingleNamespaceSchema to which schema components are being added- Parameters:
schema
- the SingleNamespaceSchema containing the compiled schema components
-
setSchemaCompiler
Set the SchemaCompiler in use- Parameters:
manager
- the schema compiler
-
getSchemaCompiler
Get the SchemaCompiler in use- Returns:
- the schema compiler
-
setReferrer
Set the xs:include, xs:import, or xs:redefine element that caused this schema document to be loaded- Parameters:
referrer
- the referring xs:include, xs:import, or xs:redefine element
-
isChameleon
public boolean isChameleon()Determine if this is a chameleon schema document, that is, one with no targetNamespace of its own, whose effective target namespace (and for many purposes, default namespace) are set to the targetNamespace of the referring schema document.- Returns:
- true if this document is a chameleon
-
prepareAttributes
Validate and process the attributes on this element in the schema document- Specified by:
prepareAttributes
in classSchemaElement
- Throws:
SchemaException
- if any errors are found in the attributes
-
isImportedNamespace
Determine whether a given URI is that of a namespace that has been imported into this schema document.- Parameters:
uri
- the namespace URI ("" for the null namespace)- Returns:
- true if the namespace has been imported, false otherwise
-
validate
Validate this schema element, checking all document-level constraints- Overrides:
validate
in classSchemaElement
- Parameters:
compiler
- used for reporting errors- Throws:
SchemaException
- if any XML representation constraints are violated
-
validateChildren
Validate the children of this node, recursively.- Overrides:
validateChildren
in classSchemaElement
- Parameters:
compiler
- used for error reporting- Throws:
SchemaException
- if the subtree is not valid
-
isFinalState
protected boolean isFinalState(int state) Description copied from class:SchemaElement
For elements whose content model is parsed using a finite state machine, test whether a given state is a final state. The default implementation of this method is never used; it exists for the benefit of subclasses that do not use this mechanism- Overrides:
isFinalState
in classSchemaElement
- Parameters:
state
- the state to be tested- Returns:
- true if the given state is a final state
-
postValidate
Process child elements after validation- Overrides:
postValidate
in classSchemaElement
- Parameters:
compiler
- used for reporting errors- Throws:
SchemaException
- if errors are found
-
getTargetNamespace
Get the target namespace of this schema document.- Returns:
NamespaceUri.NULL
for the no-namespace case
-
getAttributeFormDefault
Returns the attributeFormDefault property of this Schema.- Returns:
- the attributeFormDefault property of this Schema, or null if no default Form was set. If no default Form has been set, the user should assume Form.Unqualified. The value is returned as a string, "qualified" or "unqualified".
-
getBlockDefault
public int getBlockDefault()Returns the default BlockList for this Schema.- Returns:
- the default BlockList for this Schema, as an integer with bit-significant fields
-
getElementFormDefault
Returns the elementFormDefault property of this Schema.- Returns:
- the elementFormDefault property of this Schema. The value is returned as a string ("qualified" or "unqualified"), or null if no default Form was set. If no default Form has been set, the user should assume "unqualified".
-
getFinalDefault
public int getFinalDefault()Returns the default value of "final" for this Schema.- Returns:
- final the default value of "final" for this Schema.
-
getDefaultOpenContentWildcard
Get the default open content wildcard, if any- Returns:
- the default open content wildcard if there is one, otherwise null
-
getDefaultOpenContentMode
Get the default open content mode, as a string (interleave or suffix)- Returns:
- the default open content mode, or null if none is defined
-
defaultOpenContentAppliesToEmpty
public boolean defaultOpenContentAppliesToEmpty()Ask if the default open content wildcard applies to types that would otherwise have an EMPTY content model- Returns:
- true if open content applies by default to empty types
-
setAttributeFormDefault
Sets the attributeFormDefault property of this Schema.- Parameters:
attributeFormDefault
- the Form value of the attributeFormDefault property for this Schema, as a string, "qualified" or "unqualified". The caller is responsible for validating the value.
-
setBlockDefault
public void setBlockDefault(int value) Sets the default Block values for this Schema.- Parameters:
value
- the default Block values to set for this Schema, as a bit-significant integer.
-
setElementFormDefault
Sets the elementFormDefault property of this Schema.- Parameters:
elementFormDefault
- the Form value of the elementFormDefault property for this Schema.
-
setFinalDefault
public void setFinalDefault(int value) Set the default "final" list for this Schema.- Parameters:
value
- the default final values to set for this Schema, as a bit-significant integer
-
setDefaultOpenContent
Set the open content wildcard and mode- Parameters:
wildcard
- the default open content wildcardmode
- the default open content mode, as a stringappliesToEmpty
- true if the default open content wildcard applies to types that would otherwise have variety empty
-
getXPathDefaultNamespace
Get the value of the defaultXPathDefaultNamespace attribute defined on this element- Returns:
- the value of the defaultXPathDefaultNamespace attribute, or "##local" if no value has been defined for the attribute
-
getDefaultAttributeGroupReference
Get a reference to the default attribute group- Returns:
- a reference to the default attribute group if there is one, or null otherwise
-
getErrorCount
public int getErrorCount()Get the number of errors detected in this schema document- Returns:
- the number of errors detected
-
incrementErrorCount
public void incrementErrorCount()Increment the number of errors detected in this schema document -
addGlobalParam
Declare a global parameter for XPath expressions in this schema document (Saxon extension)- Parameters:
param
- the details of the parameter- Throws:
SchemaException
- if the variable name is a duplicate
-
getGlobalParam
Get the GlobalParam object representing a named parameter (Saxon extension)- Parameters:
name
- the parameter name- Returns:
- the GlobalParam object if a parameter with this name exists, else null
-
getGlobalParams
Return the set of global parameters defined in this schema document- Returns:
- the set of global parameters
-