## net.sf.saxon.style
Class StyleElement

    java.lang.Object
      |
      +--net.sf.saxon.om.AbstractNode
            |
            +--net.sf.saxon.tree.NodeImpl
                  |
                  +--net.sf.saxon.tree.ParentNodeImpl
                        |
                        +--net.sf.saxon.tree.ElementImpl
                              |
                              +--net.sf.saxon.tree.ElementWithAttributes
                                    |
                                    +--net.sf.saxon.style.StyleElement

All Implemented Interfaces:
  Container, javax.xml.transform.dom.DOMLocator, org.w3c.dom.Element, FingerprintedNode, InstructionInfo, Item, LocationProvider, org.xml.sax.Locator, org.w3c.dom.NamedNodeMap, org.w3c.dom.Node, NodeInfo, SaxonLocator, javax.xml.transform.Source, javax.xml.transform.SourceLocator

Direct Known Subclasses:
  AbsentExtensionElement, ExtensionInstruction, LiteralResultElement, SaxonCollation, SaxonDoctype, SaxonEntityRef, SaxonImportQuery, SaxonScript, SaxonWhile, XSLAnalyzeString, XSLApplyImports, XSLApplyTemplates, XSLAttributeSet, XSLCallTemplate, XSLCharacterMap, XSLChoose, XSLCopy, XSLCopyOf, XSLDecimalFormat, XSLDocument, XSLElement, XSLFallback, XSLForEach, XSLForEachGroup, XSLFunction, XSLGeneralIncorporate, XSLGeneralVariable, XSLIf, XSLImportSchema, XSLKey, XSLMatchingSubstring, XSLMessage, XSLNamespaceAlias, XSLNextMatch, XSLNumber, XSLOtherwise, XSLOutput, XSLOutputCharacter, XSLPerformSort, XSLPreserveSpace, XSLResultDocument, XSLSequence, XSLSort, XSLStringConstructor, XSLStylesheet, XSLTemplate, XSLWhen

public abstract class StyleElement
extends ElementWithAttributes
implements org.xml.sax.Locator, Container, InstructionInfo

Abstract superclass for all element nodes in the stylesheet.
Note: this class implements Locator. The element retains information about its own location in the stylesheet, which is useful when an XSL error is found.

Field Summary
`protected java.lang.String` `defaultXPathNamespace`
`protected short[]` `extensionNamespaces`
`static int` `REPORT_ALWAYS`
`static int` `REPORT_IF_INSTANTIATED`
`static int` `REPORT_UNLESS_FORWARDS_COMPATIBLE`
`protected int` `reportingCircumstances`
`protected StaticContext` `staticContext`
`protected javax.xml.transform.TransformerConfigurationException` `validationError`
`protected java.math.BigDecimal` `version`

Fields inherited from class net.sf.saxon.tree.ElementWithAttributes
`attributeList, namespaceList`

Fields inherited from class net.sf.saxon.tree.ElementImpl
`nameCode, root, sequence`

Fields inherited from class net.sf.saxon.tree.NodeImpl
`index, parent`

Fields inherited from class net.sf.saxon.om.AbstractNode
`NODE_LETTER`

Fields inherited from interface org.w3c.dom.Node
`ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

Fields inherited from interface net.sf.saxon.om.NodeInfo
`ALL_NAMESPACES, LOCAL_NAMESPACES, NO_NAMESPACES`

Constructor Summary
`StyleElement()` Constructor

Method Summary
`int` `allocateLocationId(java.lang.String systemId, int lineNumber)` Allocate a location identifier
`void` `allocateSlots(Expression exp)` Allocate slots in the local stack frame to range variables used in an XPath expression
`boolean` `backwardsCompatibleModeIsEnabled()` Determine whether backwards-compatible mode is enabled for this element
`XSLVariableDeclaration` `bindVariable(int fingerprint)` Bind a variable used in this element to the compiled form of the XSLVariable element in which it is declared
`void` `checkEmpty()` Convenience method to check that the stylesheet element is empty
`protected void` `checkSortComesFirst(boolean sortRequired)` Check that among the children of this element, any xsl:sort elements precede any other elements
`void` `checkTopLevel(java.lang.String errorCode)` Convenience method to check that the stylesheet element is at the top level
`protected void` `checkUnknownAttribute(int nc)` Check whether an unknown attribute is permitted.
`void` `checkWithinTemplate()` Check that the stylesheet element is within a sequence constructor
`abstract Expression` `compile(Executable exec)` Compile the instruction on the stylesheet tree into an executable instruction for use at run-time.
`Expression[]` `compileChildren(Executable exec, InstructionWithChildren inst, boolean includeParams)` Compile the children of this instruction on the stylesheet tree, adding the subordinate instructions to the parent instruction on the execution tree.
`protected void` `compileError(java.lang.String message)`
`protected void` `compileError(java.lang.String message, java.lang.String errorCode)` Compile time error, specifying an error code
`protected void` `compileError(javax.xml.transform.TransformerException error)` Construct an exception with diagnostic information
`protected void` `compileWarning(java.lang.String message)`
`protected boolean` `definesExcludedNamespace(short uriCode)` Check whether this node excludes a particular namespace from the result.
`protected boolean` `definesExtensionElement(short uriCode)` Check whether a particular extension element namespace is defined on this node.
`protected void` `fallbackProcessing(Executable exec, StyleElement instruction, java.util.List list)` Perform fallback processing.
`void` `fixupReferences()` Fix up references from XPath expressions.
`boolean` `forwardsCompatibleModeIsEnabled()` Determine whether forwards-compatible mode is enabled for this element
`protected AttributeSet[]` `getAttributeSets(java.lang.String use, java.util.List list)` Get the list of attribute-sets associated with this element.
`java.lang.String` `getAttributeValue(java.lang.String clarkName)` Get an attribute value given the Clark name of the attribute (that is, the name in {uri}local format).
`protected ItemType` `getCommonChildItemType()` Get the most general type of item returned by the children of this instruction
`protected Configuration` `getConfiguration()` Get the configuration
`int` `getConstructType()` Get the type of construct.
`SlotManager` `getContainingSlotManager()` Get the SlotManager for the containing Procedure definition
`XSLStylesheet` `getContainingStylesheet()` Get the containing XSLStylesheet element
`protected short` `getDefaultXPathNamespace()` Get the default XPath namespace code applicable to this element
`Executable` `getExecutable()` Get the Executable (representing a complete stylesheet or query) of which this Container forms part
`int` `getInstructionFingerprint()` Get the name of the instruction.
`protected StyleElement` `getLastChildInstruction()` Find the last child instruction of this instruction.
`int` `getLineNumber()` Get the line number of the instruction in the source stylesheet module.
`int` `getLineNumber(int locationId)`
`NamespaceResolver` `getNamespaceResolver()` Get the namespace context of the instruction.
`int` `getObjectFingerprint()` Get a fingerprint identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.
`int` `getObjectNameCode()` Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.
`int` `getPrecedence()` Get the import precedence of this stylesheet element.
`PreparedStylesheet` `getPreparedStylesheet()` Get the PreparedStylesheet object.
`protected XSLStylesheet` `getPrincipalStylesheet()` Get the principal XSLStylesheet node.
`java.util.Iterator` `getProperties()` Get an iterator over all the properties available.
`java.lang.Object` `getProperty(java.lang.String name)` Get the value of a particular property of the instruction.
`protected ItemType` `getReturnedItemType()` Determine the type of item returned by this instruction (only relevant if it is an instruction).
`SchemaType` `getSchemaType(java.lang.String typeAtt)` Get the Schema type definition for a type named in the stylesheet (in a "type" attribute).
`StaticContext` `getStaticContext()` Get the static context for expressions on this element
`XSLFunction` `getStylesheetFunction(int fingerprint, int arity)` Get a FunctionCall declared using an xsl:function element in the stylesheet
`java.lang.String` `getSystemId(int locationId)`
`NamePool` `getTargetNamePool()` Get the namepool to be used at run-time, this namepool holds the names used in all XPath expressions and patterns
`int` `getTypeAnnotation(SchemaType schemaType)` Get the type annotation to use for a given schema type
`java.lang.String` `getURIForPrefix(java.lang.String prefix, boolean useDefault)` Get the URI for a namespace prefix using the in-scope namespaces for this element in the stylesheet
`XSLVariableDeclaration` `getVariableBinding(int fprint)` Bind a variable used in this element to the declaration in the stylesheet
`java.math.BigDecimal` `getVersion()` Get the numeric value of the version number on this element, or inherited from its ancestors
`protected WithParam[]` `getWithParamInstructions(Executable exec, boolean tunnel)` Get the list of xsl:with-param elements for a calling element (apply-templates, call-template, apply-imports, next-match).
`boolean` `isExcludedNamespace(short uriCode)` Check whether a namespace uri defines an namespace excluded from the result.
`boolean` `isExtensionNamespace(short uriCode)` Check whether a namespace uri defines an extension element.
`boolean` `isInstruction()` Determine whether this node is an instruction.
`protected void` `issueWarning(java.lang.String message)`
`protected void` `issueWarning(javax.xml.transform.TransformerException error)` Construct an exception with diagnostic information
`boolean` `isTopLevel()` Test whether this is a top-level element
`Expression` `makeAttributeValueTemplate(java.lang.String expression)` Make an attribute value template in the context of this stylesheet element
`Expression` `makeExpression(java.lang.String expression)` Make an expression in the context of this stylesheet element
`int` `makeNameCode(java.lang.String qname)` Make a NameCode, using this Element as the context for namespace resolution, and registering the code in the namepool.
`NamespaceContext` `makeNamespaceContext()` Make a NamespaceContext object representing the list of in-scope namespaces.
`Pattern` `makePattern(java.lang.String pattern)` Make a pattern in the context of this stylesheet element
`SequenceType` `makeSequenceType(java.lang.String sequenceType)` Process an attribute whose value is a SequenceType
`protected SortKeyDefinition[]` `makeSortKeys()` Construct sort keys for a SortedIterator
`protected static TraceWrapper` `makeTraceInstruction(StyleElement source, Expression child)` Create a trace instruction to wrap a real instruction
`void` `markTailCalls()` Mark tail-recursive calls on templates and functions.
`boolean` `mayContainFallback()` Determine whether this type of element is allowed to contain an xsl:fallback instruction
`boolean` `mayContainSequenceConstructor()` Determine whether this type of element is allowed to contain a sequence constructor
`void` `postValidate()` Hook to allow additional validation of a parent element immediately after its children have been validated.
`abstract void` `prepareAttributes()` Set the attribute list for the element.
`void` `processAllAttributes()` Process the attributes of this element and all its children
`void` `processAttributes()` Process the attribute list for the element.
`protected void` `processDefaultXPathNamespaceAttribute(java.lang.String nc)` Process the [xsl:]default-xpath-namespace attribute if there is one
`protected void` `processExcludedNamespaces(java.lang.String nc)` Process the [xsl:]exclude-result-prefixes attribute if there is one
`protected void` `processExtensionElementAttribute(java.lang.String nc)` Process the [xsl:]extension-element-prefixes attribute if there is one
`protected void` `processVersionAttribute(java.lang.String nc)` Process the [xsl:]version attribute if there is one
`void` `reportAbsence(java.lang.String attribute)` Convenience method to report the absence of a mandatory attribute
`void` `setLineNumber(int lineNumber)` Set the line number of the element within its source document entity
`void` `setObjectNameCode(int nameCode)` Set the object name code
`protected void` `setValidationError(javax.xml.transform.TransformerException reason, int circumstances)` Set a validation error
`void` `substituteFor(StyleElement temp)` Make this node a substitute for a temporary one previously added to the tree.
`Expression` `typeCheck(java.lang.String name, Expression exp)` Type-check an expression.
`Pattern` `typeCheck(java.lang.String name, Pattern pat)` Type-check a pattern.
`void` `validate()` Check that the stylesheet element is valid.
`protected void` `validateChildren()` Validate the children of this node, recursively.
`void` `validateSubtree()` Recursive walk through the stylesheet to validate all nodes

Methods inherited from class net.sf.saxon.tree.ElementWithAttributes

`addNamespaceNodes, copy, getAttribute, getAttributeList, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributeValue, getLength, getNamedItem, getNamedItemNS, getNamespaceCodes, getPrefixForURI, getURICodeForPrefix, hasAttribute, hasAttributeNS, hasAttributes, initialise, item, outputNamespaceNodes, removeAttribute, removeAttributeNode, removeAttributeNS, removeNamedItem, removeNamedItemNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setNamedItem, setNamedItemNS, setNamespaceDeclarations`

Methods inherited from class net.sf.saxon.tree.ElementImpl
`addChild, compact, enumerateChildren, generateId, getBaseURI, getDocumentRoot, getFirstChild, getLastChild, getNameCode, getNodeKind, getNodeValue, getNthChild, getRoot, getSequenceNumber, getStringValue, getSystemId, hasChildNodes, setNameCode, setSystemId, useChildrenArray`

Methods inherited from class net.sf.saxon.tree.NodeImpl
`compareOrder, copy, getDisplayName, getDocumentElement, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getOriginatingNode, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getURI, isSameNodeInfo, iterateAxis, iterateAxis`

Methods inherited from class net.sf.saxon.om.AbstractNode

`appendChild, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, getChildNodes, getColumnNumber, getData, getDoctype, getDocumentNumber, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getLocalName, getName, getNamespaceURI, getNodeName, getNodeType, getOwnerDocument, getOwnerElement, getParentNode, getPublicId, getSchemaTypeInfo, getSpecified, getTagName, getTextContent, getTypeAnnotation, getTypedValue, getUserData, getValue, importNode, insertBefore, insertData, isDefaultNamespace, isEqualNode, isId, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, replaceData, setData, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setValue, splitText, substringData, supports`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.xml.sax.Locator
`getColumnNumber, getPublicId, getSystemId`

Methods inherited from interface javax.xml.transform.SourceLocator
`getColumnNumber, getPublicId, getSystemId`

Methods inherited from interface net.sf.saxon.trace.InstructionInfo
`getSystemId`

Methods inherited from interface org.w3c.dom.Element
`getElementsByTagName, getElementsByTagNameNS, getTagName`

Methods inherited from interface org.w3c.dom.Node
`appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix`

Field Detail

### extensionNamespaces

    protected short[] extensionNamespaces

### version

    protected java.math.BigDecimal version

### staticContext

    protected StaticContext staticContext

### validationError

    protected javax.xml.transform.TransformerConfigurationException validationError

### reportingCircumstances

    protected int reportingCircumstances

### defaultXPathNamespace

    protected java.lang.String defaultXPathNamespace

### REPORT_ALWAYS

    public static final int REPORT_ALWAYS

See Also:
  Constant Field Values

### REPORT_UNLESS_FORWARDS_COMPATIBLE

    public static final int REPORT_UNLESS_FORWARDS_COMPATIBLE

See Also:
  Constant Field Values

### REPORT_IF_INSTANTIATED

    public static final int REPORT_IF_INSTANTIATED

See Also:
  Constant Field Values

Constructor Detail

### StyleElement

    public StyleElement()

  Constructor

Method Detail

### getExecutable

    public Executable getExecutable()

  Description copied from interface: `Container`
  Get the Executable (representing a complete stylesheet or query) of which this Container forms part

  Specified by:
    `getExecutable` in interface `Container`

### getTargetNamePool

    public NamePool getTargetNamePool()

  Get the namepool to be used at run-time, this namepool holds the names used in all XPath expressions and patterns

### getConfiguration

    protected Configuration getConfiguration()

  Get the configuration

### getStaticContext

    public StaticContext getStaticContext()

  Get the static context for expressions on this element

  Returns:
    the static context

### getLineNumber

    public int getLineNumber()

  Description copied from interface: `InstructionInfo`
  Get the line number of the instruction in the source stylesheet module. If this is not known, or if the instruction is an artificial one that does not relate to anything in the source code, the value returned may be -1.

  Specified by:
    `getLineNumber` in interface `org.xml.sax.Locator`
  Overrides:
    `getLineNumber` in class `ElementImpl`
  Returns:
    the line number of the node in its original source document; or -1 if not available

### setLineNumber

    public void setLineNumber(int lineNumber)

  Description copied from class: `ElementImpl`
  Set the line number of the element within its source document entity

  Overrides:
    `setLineNumber` in class `ElementImpl`

### substituteFor

    public void substituteFor(StyleElement temp)

  Make this node a substitute for a temporary one previously added to the tree. See StyleNodeFactory for details. "A node like the other one in all things but its class". Note that at this stage, the node will not yet be known to its parent, though it will contain a reference to its parent; and it will have no children.

### setValidationError

    protected void setValidationError(javax.xml.transform.TransformerException reason,
                                      int circumstances)

  Set a validation error

### isInstruction

    public boolean isInstruction()

  Determine whether this node is an instruction. The default implementation says it isn't.

### getReturnedItemType

    protected ItemType getReturnedItemType()

  Determine the type of item returned by this instruction (only relevant if it is an instruction). Default implementation returns Type.ITEM, indicating that we don't know, it might be anything. Returns null in the case of an element such as xsl:sort or xsl:variable that can appear in a sequence constructor but contributes nothing to the result sequence.

  Returns:
    the item type returned

### getCommonChildItemType

    protected ItemType getCommonChildItemType()

  Get the most general type of item returned by the children of this instruction

  Returns:
    the lowest common supertype of the item types returned by the children

### markTailCalls

    public void markTailCalls()

  Mark tail-recursive calls on templates and functions. For most instructions, this does nothing.

### mayContainSequenceConstructor

    public boolean mayContainSequenceConstructor()

  Determine whether this type of element is allowed to contain a sequence constructor

### mayContainFallback

    public boolean mayContainFallback()

  Determine whether this type of element is allowed to contain an xsl:fallback instruction

### getContainingStylesheet

    public XSLStylesheet getContainingStylesheet()

  Get the containing XSLStylesheet element

### getPrecedence

    public int getPrecedence()

  Get the import precedence of this stylesheet element.

### getURIForPrefix

    public java.lang.String getURIForPrefix(java.lang.String prefix,
                                            boolean useDefault)
                                     throws NamespaceException

  Get the URI for a namespace prefix using the in-scope namespaces for this element in the stylesheet

  Parameters:
    `prefix` - The namespace prefix: may be the empty string
    `useDefault` - True if the default namespace is to be used when the prefix is "".
  Throws:
    `NamespaceException` - if the prefix is not declared

### makeNameCode

    public final int makeNameCode(java.lang.String qname)
                           throws XPathException,
                                  NamespaceException

  Make a NameCode, using this Element as the context for namespace resolution, and registering the code in the namepool. If the name is unprefixed, the default namespace is not used.

  Parameters:
    `qname` - The name as written, in the form "[prefix:]localname". The name must have already been validated as a syntactically-correct QName.
  Throws:
    `XPathException` - if the qname is not a lexically-valid QName, or if the name is in a reserved namespace.
    `NamespaceException` - if the prefix of the qname has not been declared

### makeNamespaceContext

    public NamespaceContext makeNamespaceContext()

  Make a NamespaceContext object representing the list of in-scope namespaces. The NamePool used for numeric codes in the NamespaceContext will be the target name pool.

### processAllAttributes

    public void processAllAttributes()
                              throws javax.xml.transform.TransformerConfigurationException

  Process the attributes of this element and all its children

    `javax.xml.transform.TransformerConfigurationException`

### getAttributeValue

    public java.lang.String getAttributeValue(java.lang.String clarkName)

  Get an attribute value given the Clark name of the attribute (that is, the name in {uri}local format).

### processAttributes

    public final void processAttributes()
                                 throws javax.xml.transform.TransformerConfigurationException

  Process the attribute list for the element. This is a wrapper method that calls prepareAttributes (provided in the subclass) and traps any exceptions

    `javax.xml.transform.TransformerConfigurationException`

### checkUnknownAttribute

    protected void checkUnknownAttribute(int nc)
                                  throws javax.xml.transform.TransformerConfigurationException

  Check whether an unknown attribute is permitted.

  Parameters:
    `nc` - The name code of the attribute name
    `javax.xml.transform.TransformerConfigurationException`

### prepareAttributes

    public abstract void prepareAttributes()
                                    throws javax.xml.transform.TransformerConfigurationException

  Set the attribute list for the element. This is called to process the attributes (note the distinction from processAttributes in the superclass). Must be supplied in a subclass

    `javax.xml.transform.TransformerConfigurationException`

### getLastChildInstruction

    protected StyleElement getLastChildInstruction()

  Find the last child instruction of this instruction. Returns null if there are no child instructions, or if the last child is a text node.

### makeExpression

    public Expression makeExpression(java.lang.String expression)
                              throws javax.xml.transform.TransformerConfigurationException

  Make an expression in the context of this stylesheet element

    `javax.xml.transform.TransformerConfigurationException`

### makePattern

    public Pattern makePattern(java.lang.String pattern)
                        throws javax.xml.transform.TransformerConfigurationException

  Make a pattern in the context of this stylesheet element

    `javax.xml.transform.TransformerConfigurationException`

### makeAttributeValueTemplate

    public Expression makeAttributeValueTemplate(java.lang.String expression)
                                          throws javax.xml.transform.TransformerConfigurationException

  Make an attribute value template in the context of this stylesheet element

    `javax.xml.transform.TransformerConfigurationException`

### makeSequenceType

    public SequenceType makeSequenceType(java.lang.String sequenceType)
                                  throws javax.xml.transform.TransformerConfigurationException

  Process an attribute whose value is a SequenceType

    `javax.xml.transform.TransformerConfigurationException`

### processExtensionElementAttribute

    protected void processExtensionElementAttribute(java.lang.String nc)
                                             throws javax.xml.transform.TransformerConfigurationException

  Process the [xsl:]extension-element-prefixes attribute if there is one

  Parameters:
    `nc` - the Clark name of the attribute required
    `javax.xml.transform.TransformerConfigurationException`

### processExcludedNamespaces

    protected void processExcludedNamespaces(java.lang.String nc)
                                      throws javax.xml.transform.TransformerConfigurationException

  Process the [xsl:]exclude-result-prefixes attribute if there is one

  Parameters:
    `nc` - the Clark name of the attribute required
    `javax.xml.transform.TransformerConfigurationException`

### processVersionAttribute

    protected void processVersionAttribute(java.lang.String nc)
                                    throws javax.xml.transform.TransformerConfigurationException

  Process the [xsl:]version attribute if there is one

  Parameters:
    `nc` - the Clark name of the attribute required
    `javax.xml.transform.TransformerConfigurationException`

### getVersion

    public java.math.BigDecimal getVersion()

  Get the numeric value of the version number on this element, or inherited from its ancestors

### forwardsCompatibleModeIsEnabled

    public boolean forwardsCompatibleModeIsEnabled()

  Determine whether forwards-compatible mode is enabled for this element

### backwardsCompatibleModeIsEnabled

    public boolean backwardsCompatibleModeIsEnabled()

  Determine whether backwards-compatible mode is enabled for this element

### definesExtensionElement

    protected boolean definesExtensionElement(short uriCode)

  Check whether a particular extension element namespace is defined on this node. This checks this node only, not the ancestor nodes. The implementation checks whether the prefix is included in the [xsl:]extension-element-prefixes attribute.

  Parameters:
    `uriCode` - the namespace URI code being tested

### isExtensionNamespace

    public boolean isExtensionNamespace(short uriCode)

  Check whether a namespace uri defines an extension element. This checks whether the namespace is defined as an extension namespace on this or any ancestor node.

  Parameters:
    `uriCode` - the namespace URI code being tested

### definesExcludedNamespace

    protected boolean definesExcludedNamespace(short uriCode)

  Check whether this node excludes a particular namespace from the result. This method checks this node only, not the ancestor nodes.

  Parameters:
    `uriCode` - the code of the namespace URI being tested

### isExcludedNamespace

    public boolean isExcludedNamespace(short uriCode)

  Check whether a namespace uri defines an namespace excluded from the result. This checks whether the namespace is defined as an excluded namespace on this or any ancestor node.

  Parameters:
    `uriCode` - the code of the namespace URI being tested

### processDefaultXPathNamespaceAttribute

    protected void processDefaultXPathNamespaceAttribute(java.lang.String nc)
                                                  throws javax.xml.transform.TransformerConfigurationException

  Process the [xsl:]default-xpath-namespace attribute if there is one

  Parameters:
    `nc` - the Clark name of the attribute required
    `javax.xml.transform.TransformerConfigurationException`

### getDefaultXPathNamespace

    protected short getDefaultXPathNamespace()

  Get the default XPath namespace code applicable to this element

### getSchemaType

    public SchemaType getSchemaType(java.lang.String typeAtt)
                             throws javax.xml.transform.TransformerConfigurationException

  Get the Schema type definition for a type named in the stylesheet (in a "type" attribute).

  Throws:
    `javax.xml.transform.TransformerConfigurationException` - if the type is not declared in an imported schema, or is not a built-in type

### getTypeAnnotation

    public int getTypeAnnotation(SchemaType schemaType)

  Get the type annotation to use for a given schema type

### validate

    public void validate()
                  throws javax.xml.transform.TransformerConfigurationException

  Check that the stylesheet element is valid. This is called once for each element, after the entire tree has been built. As well as validation, it can perform first-time initialisation. The default implementation does nothing; it is normally overriden in subclasses.

    `javax.xml.transform.TransformerConfigurationException`

### postValidate

    public void postValidate()
                      throws javax.xml.transform.TransformerConfigurationException

  Hook to allow additional validation of a parent element immediately after its children have been validated.

    `javax.xml.transform.TransformerConfigurationException`

### typeCheck

    public Expression typeCheck(java.lang.String name,
                                Expression exp)
                         throws javax.xml.transform.TransformerConfigurationException

  Type-check an expression. This is called to check each expression while the containing instruction is being validated. It is not just a static type-check, it also adds code to perform any necessary run-time type checking and/or conversion. It also allocates slot numbers for range variables declared within the expression.

    `javax.xml.transform.TransformerConfigurationException`

### allocateSlots

    public void allocateSlots(Expression exp)

  Allocate slots in the local stack frame to range variables used in an XPath expression

  Parameters:
    `exp` - the XPath expression for which slots are to be allocated

### typeCheck

    public Pattern typeCheck(java.lang.String name,
                             Pattern pat)
                      throws javax.xml.transform.TransformerConfigurationException

  Type-check a pattern. This is called to check each pattern while the containing instruction is being validated. It is not just a static type-check, it also adds code to perform any necessary run-time type checking and/or conversion.

    `javax.xml.transform.TransformerConfigurationException`

### fixupReferences

    public void fixupReferences()
                         throws javax.xml.transform.TransformerConfigurationException

  Fix up references from XPath expressions. Overridden for function declarations and variable declarations

    `javax.xml.transform.TransformerConfigurationException`

### getContainingSlotManager

    public SlotManager getContainingSlotManager()

  Get the SlotManager for the containing Procedure definition

  Returns:
    the SlotManager associated with the containing Function, Template, etc, or null if there is no such containing Function, Template etc.

### validateSubtree

    public void validateSubtree()
                         throws javax.xml.transform.TransformerConfigurationException

  Recursive walk through the stylesheet to validate all nodes

    `javax.xml.transform.TransformerConfigurationException`

### validateChildren

    protected void validateChildren()
                             throws javax.xml.transform.TransformerConfigurationException

  Validate the children of this node, recursively. Overridden for top-level data elements.

    `javax.xml.transform.TransformerConfigurationException`

### getPrincipalStylesheet

    protected XSLStylesheet getPrincipalStylesheet()

  Get the principal XSLStylesheet node. This gets the principal style sheet, i.e. the one originally loaded, that forms the root of the import/include tree

### getPreparedStylesheet

    public PreparedStylesheet getPreparedStylesheet()

  Get the PreparedStylesheet object.

  Returns:
    the PreparedStylesheet to which this stylesheet element belongs

### checkWithinTemplate

    public void checkWithinTemplate()
                             throws javax.xml.transform.TransformerConfigurationException

  Check that the stylesheet element is within a sequence constructor

  Throws:
    `javax.xml.transform.TransformerConfigurationException` - if not within a sequence constructor

### checkSortComesFirst

    protected void checkSortComesFirst(boolean sortRequired)
                                throws javax.xml.transform.TransformerConfigurationException

  Check that among the children of this element, any xsl:sort elements precede any other elements

  Parameters:
    `sortRequired` - true if there must be at least one xsl:sort element
  Throws:
    `javax.xml.transform.TransformerConfigurationException` - if invalid

### checkTopLevel

    public void checkTopLevel(java.lang.String errorCode)
                       throws javax.xml.transform.TransformerConfigurationException

  Convenience method to check that the stylesheet element is at the top level

  Throws:
    `javax.xml.transform.TransformerConfigurationException` - if not at top level

### checkEmpty

    public void checkEmpty()
                    throws javax.xml.transform.TransformerConfigurationException

  Convenience method to check that the stylesheet element is empty

  Throws:
    `javax.xml.transform.TransformerConfigurationException` - if it is not empty

### reportAbsence

    public void reportAbsence(java.lang.String attribute)
                       throws javax.xml.transform.TransformerConfigurationException

  Convenience method to report the absence of a mandatory attribute

  Throws:
    `javax.xml.transform.TransformerConfigurationException` - if the attribute is missing

### compile

    public abstract Expression compile(Executable exec)
                                throws javax.xml.transform.TransformerConfigurationException

  Compile the instruction on the stylesheet tree into an executable instruction for use at run-time.

  Returns:
    either an Instruction, or null. The value null is returned when compiling an instruction that returns a no-op, or when compiling a top-level object such as an xsl:template that compiles into something other than an instruction.
    `javax.xml.transform.TransformerConfigurationException`

### compileChildren

    public Expression[] compileChildren(Executable exec,
                                        InstructionWithChildren inst,
                                        boolean includeParams)
                                 throws javax.xml.transform.TransformerConfigurationException

  Compile the children of this instruction on the stylesheet tree, adding the subordinate instructions to the parent instruction on the execution tree.

  Returns:
    the array of children
    `javax.xml.transform.TransformerConfigurationException`

### makeTraceInstruction

    protected static TraceWrapper makeTraceInstruction(StyleElement source,
                                                       Expression child)

  Create a trace instruction to wrap a real instruction

### fallbackProcessing

    protected void fallbackProcessing(Executable exec,
                                      StyleElement instruction,
                                      java.util.List list)
                               throws javax.xml.transform.TransformerConfigurationException

  Perform fallback processing. Generate fallback code for an extension instruction that is not recognized by the implementation.

  Parameters:
    `instruction` - The unknown extension instruction
    `list` - a List to be populated with instructions. The method creates one Block instruction for each xsl:fallback found.
    `javax.xml.transform.TransformerConfigurationException`

### allocateLocationId

    public int allocateLocationId(java.lang.String systemId,
                                  int lineNumber)

  Allocate a location identifier

### makeSortKeys

    protected SortKeyDefinition[] makeSortKeys()

  Construct sort keys for a SortedIterator

  Returns:
    an array of SortKeyDefinition objects if there are any sort keys; or null if there are none.

### getAttributeSets

    protected AttributeSet[] getAttributeSets(java.lang.String use,
                                              java.util.List list)
                                       throws javax.xml.transform.TransformerConfigurationException

  Get the list of attribute-sets associated with this element. This is used for xsl:element, xsl:copy, xsl:attribute-set, and on literal result elements

  Returns:
    an array of AttributeList instructions representing the compiled attribute sets
    `javax.xml.transform.TransformerConfigurationException`

### getWithParamInstructions

    protected WithParam[] getWithParamInstructions(Executable exec,
                                                   boolean tunnel)
                                            throws javax.xml.transform.TransformerConfigurationException

  Get the list of xsl:with-param elements for a calling element (apply-templates, call-template, apply-imports, next-match). This method can be used to get either the tunnel parameters, or the non-tunnel parameters.

  Parameters:
    `tunnel` - true if the tunnel="yes" parameters are wanted, false to get the non-tunnel parameters
    `javax.xml.transform.TransformerConfigurationException`

### compileError

    protected void compileError(javax.xml.transform.TransformerException error)
                         throws javax.xml.transform.TransformerConfigurationException

  Construct an exception with diagnostic information

    `javax.xml.transform.TransformerConfigurationException`

### compileError

    protected void compileError(java.lang.String message)
                         throws javax.xml.transform.TransformerConfigurationException

    `javax.xml.transform.TransformerConfigurationException`

### compileError

    protected void compileError(java.lang.String message,
                                java.lang.String errorCode)
                         throws javax.xml.transform.TransformerConfigurationException

  Compile time error, specifying an error code

  Parameters:
    `message` - the error message
    `errorCode` - the error code. May be null if not known or not defined
  Throws:
    `javax.xml.transform.TransformerConfigurationException`

### compileWarning

    protected void compileWarning(java.lang.String message)
                           throws javax.xml.transform.TransformerConfigurationException

    `javax.xml.transform.TransformerConfigurationException`

### issueWarning

    protected void issueWarning(javax.xml.transform.TransformerException error)

  Construct an exception with diagnostic information

### issueWarning

    protected void issueWarning(java.lang.String message)

### isTopLevel

    public boolean isTopLevel()

  Test whether this is a top-level element

### bindVariable

    public XSLVariableDeclaration bindVariable(int fingerprint)
                                        throws StaticError

  Bind a variable used in this element to the compiled form of the XSLVariable element in which it is declared

  Parameters:
    `fingerprint` - The fingerprint of the name of the variable
  Returns:
    the XSLVariableDeclaration (that is, an xsl:variable or xsl:param instruction) for the variable
  Throws:
    `StaticError` - if the variable has not been declared

### getVariableBinding

    public XSLVariableDeclaration getVariableBinding(int fprint)

  Bind a variable used in this element to the declaration in the stylesheet

  Parameters:
    `fprint` - The absolute name of the variable (prefixed by namespace URI)
  Returns:
    the XSLVariableDeclaration, or null if it has not been declared

### getStylesheetFunction

    public XSLFunction getStylesheetFunction(int fingerprint,
                                             int arity)

  Get a FunctionCall declared using an xsl:function element in the stylesheet

  Parameters:
    `fingerprint` - the fingerprint of the name of the function
    `arity` - the number of arguments in the function call. The value -1 indicates that any arity will do (this is used to support the function-available() function).
  Returns:
    the XSLFunction object representing the function declaration in the stylesheet, or null if no such function is defined.

### getConstructType

    public int getConstructType()

  Get the type of construct. This will be a constant in class `Location`. This method is part of the `InstructionInfo` interface

  Specified by:
    `getConstructType` in interface `InstructionInfo`

### getInstructionFingerprint

    public int getInstructionFingerprint()

  Get the name of the instruction. This is applicable only when the construct type is Location.INSTRUCTION.

  Specified by:
    `getInstructionFingerprint` in interface `InstructionInfo`

### getObjectNameCode

    public int getObjectNameCode()

  Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically. If there is no name, the value will be -1.

  Specified by:
    `getObjectNameCode` in interface `InstructionInfo`

### getObjectFingerprint

    public int getObjectFingerprint()

  Get a fingerprint identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically. If there is no name, the value will be -1.

### setObjectNameCode

    public void setObjectNameCode(int nameCode)

  Set the object name code

### getNamespaceResolver

    public NamespaceResolver getNamespaceResolver()

  Get the namespace context of the instruction.

  Specified by:
    `getNamespaceResolver` in interface `InstructionInfo`

### getProperty

    public java.lang.Object getProperty(java.lang.String name)

  Get the value of a particular property of the instruction. This is part of the `InstructionInfo` interface for run-time tracing and debugging. The properties available include all the attributes of the source instruction (named by the attribute name): these are all provided as string values.

  Specified by:
    `getProperty` in interface `InstructionInfo`
  Parameters:
    `name` - The name of the required property
  Returns:
    The value of the requested property, or null if the property is not available

### getProperties

    public java.util.Iterator getProperties()

  Get an iterator over all the properties available. The values returned by the iterator will be of type String, and each string can be supplied as input to the getProperty() method to retrieve the value of the property.

  Specified by:
    `getProperties` in interface `InstructionInfo`

### getSystemId

    public java.lang.String getSystemId(int locationId)

  Specified by:
    `getSystemId` in interface `LocationProvider`

### getLineNumber

    public int getLineNumber(int locationId)

  Specified by:
    `getLineNumber` in interface `LocationProvider`