public abstract class StyleElement extends ElementWithAttributes implements Locator
Modifier and Type | Field and Description |
---|---|
protected Vector |
attributeSets |
protected short[] |
extensionNamespaces |
static int |
REPORT_ALWAYS |
static int |
REPORT_IF_INSTANTIATED |
static int |
REPORT_UNLESS_FORWARDS_COMPATIBLE |
protected int |
reportingCircumstances |
protected int |
sequence |
protected StaticContext |
staticContext |
protected TransformerConfigurationException |
validationError |
protected String |
version |
attributeList, namespaceList
nameCode, root
emptyArray, index, parent
NODE_LETTER
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
StyleElement()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(NodeImpl node,
int index)
Add a child node to this node.
|
Binding |
bindVariable(int fingerprint)
Bind a variable used in this element to the XSLVariable element in which it is declared
|
void |
checkEmpty()
Convenience method to check that the stylesheet element is empty
|
void |
checkNotTopLevel()
Convenience method to check that the stylesheet element is not at the top level
|
void |
checkTopLevel()
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 template body
|
void |
compact(int size)
Compact the space used by this node
|
protected void |
compileError(String message) |
protected void |
compileError(TransformerException error)
Construct an exception with diagnostic information
|
void |
copyStringValue(Outputter out)
Copy the string-value of this node to a given outputter
|
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.
|
boolean |
doesPostProcessing()
Determine whether this element does any processing after instantiating any children.
|
void |
dropChildren()
Drop a branch of the tree.
|
AxisEnumeration |
enumerateChildren(NodeTest test)
Get an enumeration of the children of this node
|
protected void |
fallbackProcessing(StyleElement instruction,
Context context)
Perform fallback processing
|
protected void |
findAttributeSets(String use)
Determine the list of attribute-sets associated with this element.
|
boolean |
forwardsCompatibleModeIsEnabled()
Determine whether forwards-compatible mode is enabled for this element
|
NodeList |
getChildNodes()
Return a
NodeList that contains all children of this node. |
XSLStyleSheet |
getContainingStyleSheet()
Get the containing XSLStyleSheet element
|
Node |
getFirstChild()
Get the first child node of the element
|
Node |
getLastChild()
Get the last child node of the element
|
String |
getNodeValue()
Get the node value as defined in the DOM.
|
protected NodeImpl |
getNthChild(int n)
Get the nth child node of the element (numbering from 0)
|
int |
getPrecedence()
Get the import precedence of this stylesheet element.
|
PreparedStyleSheet |
getPreparedStyleSheet()
Get the PreparedStyleSheet object.
|
protected XSLStyleSheet |
getPrincipalStyleSheet()
Get the principal XSLStyleSheet node.
|
protected long |
getSequenceNumber()
Get the node sequence number (in document order).
|
StandardNames |
getStandardNames()
Get the StandardNames object
|
String |
getStringValue()
Return the string-value of the node, that is, the concatenation
of the character content of all descendent elements and text nodes.
|
Function |
getStyleSheetFunction(int fingerprint)
Get a Function declared using a saxon:function element in the stylesheet
|
Binding |
getVariableBinding(int fprint)
Bind a variable used in this element to the XSLVariable element in which it is declared
|
Enumeration[] |
getVariableNames()
List the variables that are in scope for this stylesheet element.
|
String |
getVersion()
Get the version number on this element, or inherited from its ancestors
|
protected Expression |
handleSortKeys(Expression select)
Modify the "select" expression to include any sort keys specified.
|
boolean |
hasChildNodes()
Determine if the node has any children.
|
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.
|
boolean |
isTopLevel()
Test whether this is a top-level element
|
Expression |
makeAttributeValueTemplate(String expression)
Make an attribute value template in the context of this stylesheet element
|
Expression |
makeExpression(String expression)
Make an expression in the context of this stylesheet element
|
Pattern |
makePattern(String pattern)
Make a pattern in the context of this stylesheet element
|
boolean |
mayContainTemplateBody()
Determine whether this type of element is allowed to contain a template-body
|
abstract void |
prepareAttributes()
Set the attribute list for the element.
|
void |
preprocess()
Default preprocessing method does nothing.
|
abstract void |
process(Context context)
Process: called to do the real work of this stylesheet element.
|
void |
processAllAttributes()
Process the attributes of this element and all its children
|
void |
processAttributes()
Process the attribute list for the element.
|
protected void |
processAttributeSets(Context context)
Expand the attribute sets referenced in this element's use-attribute-sets attribute
|
void |
processChildren(Context context)
Process the children of this node in the stylesheet
|
protected void |
processExcludedNamespaces(int nc)
Process the [xsl:]exclude-result-prefixes attribute if there is one
|
protected void |
processExtensionElementAttribute(int nc)
Process the [xsl:]extension-element-prefixes attribute if there is one
|
protected void |
processVersionAttribute(int nc)
Process the [xsl:]version attribute if there is one
|
void |
removeChild(int index)
Remove node at given index.
|
void |
renumberChildren()
Renumber the children of a given parent node.
|
void |
reportAbsence(String attribute)
Convenience method to report the absence of a mandatory attribute
|
protected void |
setValidationError(TransformerException reason,
int circumstances)
Set a validation error
|
protected TransformerException |
styleError(String message) |
protected TransformerException |
styleError(TransformerException error)
Construct an exception with diagnostic information
|
void |
substituteFor(StyleElement temp)
Make this node a substitute for a temporary one previously added to the tree.
|
void |
useChildrenArray(NodeImpl[] array)
Supply an array to be used for the array of children.
|
void |
validate()
Check that the element is valid.
|
protected void |
validateChildren() |
void |
validateSubtree()
Recursive walk through the stylesheet to validate all nodes
|
addNamespaceNodes, copy, getAttribute, getAttributeList, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributeValue, getAttributeValue, 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
copy, generateId, getBaseURI, getDocumentRoot, getLineNumber, getNameCode, getNodeType, getSystemId, makeNameCode, setLineNumber, setNameCode, setSystemId
compareOrder, getDisplayName, getDocumentElement, getEnumeration, getFingerprint, getLocalName, getNamePool, getNextInDocument, getNextSibling, getOriginatingNode, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getURI, isSameNodeInfo, removeNode
appendChild, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, getColumnNumber, getData, getDoctype, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getName, getNamespaceURI, getNodeName, getOwnerDocument, getOwnerElement, getParentNode, getPublicId, getSchemaTypeInfo, getSpecified, getTagName, getTextContent, getUserData, getValue, getWholeText, importNode, insertBefore, insertData, isDefaultNamespace, isElementContentWhitespace, isEqualNode, isId, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, replaceData, replaceWholeText, setData, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setUserData, setValue, splitText, substringData, supports
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumnNumber, getLineNumber, getPublicId, getSystemId
getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, setIdAttribute, setIdAttributeNode, setIdAttributeNS
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
protected Vector attributeSets
protected short[] extensionNamespaces
protected String version
protected StaticContext staticContext
protected TransformerConfigurationException validationError
protected int reportingCircumstances
public static final int REPORT_ALWAYS
public static final int REPORT_UNLESS_FORWARDS_COMPATIBLE
public static final int REPORT_IF_INSTANTIATED
protected int sequence
public void substituteFor(StyleElement temp)
protected void setValidationError(TransformerException reason, int circumstances)
public boolean isInstruction()
public boolean doesPostProcessing()
public boolean mayContainTemplateBody()
public XSLStyleSheet getContainingStyleSheet()
public int getPrecedence()
public final StandardNames getStandardNames()
public void processAllAttributes() throws TransformerConfigurationException
public final void processAttributes() throws TransformerConfigurationException
protected void checkUnknownAttribute(int nc) throws TransformerConfigurationException
nc
- The name code of the attribute nameTransformerConfigurationException
public abstract void prepareAttributes() throws TransformerConfigurationException
public Expression makeExpression(String expression) throws TransformerConfigurationException
public Pattern makePattern(String pattern) throws TransformerConfigurationException
public Expression makeAttributeValueTemplate(String expression) throws TransformerConfigurationException
protected void processExtensionElementAttribute(int nc) throws TransformerConfigurationException
nc
- the name code of the attribute requiredTransformerConfigurationException
protected void processExcludedNamespaces(int nc) throws TransformerConfigurationException
nc
- the name code of the attribute requiredTransformerConfigurationException
protected void processVersionAttribute(int nc)
nc
- the name code of the attribute requiredpublic String getVersion()
public boolean forwardsCompatibleModeIsEnabled()
protected boolean definesExtensionElement(short uriCode)
uriCode
- the namespace URI code being testedpublic boolean isExtensionNamespace(short uriCode)
uriCode
- the namespace URI code being testedprotected boolean definesExcludedNamespace(short uriCode)
uriCode
- the code of the namespace URI being testedpublic boolean isExcludedNamespace(short uriCode)
uriCode
- the code of the namespace URI being testedpublic void validate() throws TransformerConfigurationException
public void preprocess() throws TransformerConfigurationException
public void validateSubtree() throws TransformerConfigurationException
protected void validateChildren() throws TransformerConfigurationException
protected XSLStyleSheet getPrincipalStyleSheet()
public PreparedStyleSheet getPreparedStyleSheet()
public void checkWithinTemplate() throws TransformerConfigurationException
TransformerConfigurationException
- if not within a template bodypublic void checkTopLevel() throws TransformerConfigurationException
TransformerConfigurationException
- if not at top levelpublic void checkNotTopLevel() throws TransformerConfigurationException
TransformerConfigurationException
- if it is at the top levelpublic void checkEmpty() throws TransformerConfigurationException
TransformerConfigurationException
- if it is not emptypublic void reportAbsence(String attribute) throws TransformerConfigurationException
TransformerConfigurationException
- if the attribute is missingpublic abstract void process(Context context) throws TransformerException
context
- The context in the source XML document, giving access to the current node,
the current variables, etc.TransformerException
public void processChildren(Context context) throws TransformerException
context
- The context in the source XML document, giving access to the current node,
the current variables, etc.TransformerException
protected void fallbackProcessing(StyleElement instruction, Context context) throws TransformerException
TransformerException
protected Expression handleSortKeys(Expression select) throws TransformerConfigurationException
protected void findAttributeSets(String use) throws TransformerConfigurationException
protected void processAttributeSets(Context context) throws TransformerException
TransformerException
protected TransformerException styleError(TransformerException error)
protected TransformerException styleError(String message)
protected void compileError(TransformerException error) throws TransformerConfigurationException
protected void compileError(String message) throws TransformerConfigurationException
public boolean isTopLevel()
public Binding bindVariable(int fingerprint) throws XPathException
fingerprint
- The fingerprint of the name of the variableXPathException
- if the variable has not been declaredpublic Binding getVariableBinding(int fprint)
fprint
- The absolute name of the variable (as a namepool fingerprint)public Enumeration[] getVariableNames()
public Function getStyleSheetFunction(int fingerprint)
fingerprint
- the fingerprint of the name of the functionprotected final long getSequenceNumber()
getSequenceNumber
in class NodeImpl
public final boolean hasChildNodes()
hasChildNodes
in interface NodeInfo
hasChildNodes
in interface Node
hasChildNodes
in class NodeImpl
true
if the node has any children,
false
if the node has no children.public final AxisEnumeration enumerateChildren(NodeTest test)
public final Node getFirstChild()
getFirstChild
in interface Node
getFirstChild
in class NodeImpl
public final Node getLastChild()
getLastChild
in interface Node
getLastChild
in class NodeImpl
public final NodeList getChildNodes()
NodeList
that contains all children of this node. If
there are no children, this is a NodeList
containing no
nodes.getChildNodes
in interface Node
getChildNodes
in class NodeImpl
protected final NodeImpl getNthChild(int n)
public String getStringValue()
public void copyStringValue(Outputter out) throws TransformerException
copyStringValue
in interface NodeInfo
copyStringValue
in class AbstractNode
TransformerException
public void useChildrenArray(NodeImpl[] array)
public void addChild(NodeImpl node, int index)
public void removeChild(int index)
public void renumberChildren()
public void dropChildren()
public void compact(int size)
public String getNodeValue()
getNodeValue
in interface Node
getNodeValue
in class AbstractNode