|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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 | |
void |
allocateSlots(Expression exp)
|
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 |
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 sequence constructor |
abstract Instruction |
compile(Executable exec)
Compile the instruction on the stylesheet tree into an executable instruction for use at run-time. |
Instruction[] |
compileChildren(Executable exec,
Instruction inst)
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(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 |
XSLStyleSheet |
getContainingStyleSheet()
Get the containing XSLStyleSheet element |
ItemType |
getContextItemType()
Get the static type of the context item in the content constructor contained by this element. |
protected short |
getDefaultXPathNamespace()
Get the default XPath namespace code applicable to this element |
protected StyleElement |
getLastChildInstruction()
Find the last child instruction of this instruction. |
int |
getLineNumber()
Get the line number of the node within its source document entity |
Procedure |
getOwningProcedure()
Get the owning Procedure definition, if this is a local variable |
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 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). |
XSLFunction |
getStyleSheetFunction(int fingerprint,
int arity)
Get a FunctionCall declared using an xsl:function element in the stylesheet |
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 |
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 |
protected void |
setAdditionalTraceProperties(TraceInstruction trace)
Set additional trace properties appropriate to the kind of instruction. |
void |
setLineNumber(int lineNumber)
Set the line number of the element within its source document entity |
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.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, isSameNode, iterateAxis, iterateAxis |
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 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 |
protected short[] extensionNamespaces
protected java.math.BigDecimal version
protected StaticContext staticContext
protected javax.xml.transform.TransformerConfigurationException validationError
protected int reportingCircumstances
protected java.lang.String defaultXPathNamespace
public static final int REPORT_ALWAYS
public static final int REPORT_UNLESS_FORWARDS_COMPATIBLE
public static final int REPORT_IF_INSTANTIATED
Constructor Detail |
public StyleElement()
Method Detail |
public NamePool getTargetNamePool()
protected Configuration getConfiguration()
public int getLineNumber()
ElementImpl
getLineNumber
in interface org.xml.sax.Locator
getLineNumber
in class ElementImpl
public void setLineNumber(int lineNumber)
ElementImpl
setLineNumber
in class ElementImpl
public void substituteFor(StyleElement temp)
protected void setValidationError(javax.xml.transform.TransformerException reason, int circumstances)
public boolean isInstruction()
protected ItemType getReturnedItemType()
protected ItemType getCommonChildItemType()
public void markTailCalls()
public boolean mayContainSequenceConstructor()
public boolean mayContainFallback()
public XSLStyleSheet getContainingStyleSheet()
public int getPrecedence()
public java.lang.String getURIForPrefix(java.lang.String prefix, boolean useDefault) throws NamespaceException
prefix
- The namespace prefix: may be the empty stringuseDefault
- True if the default namespace is to be used when the
prefix is "".
NamespaceException
- if the prefix is not declaredpublic final int makeNameCode(java.lang.String qname) throws XPathException, NamespaceException
qname
- The name as written, in the form "[prefix:]localname". The name must have
already been validated as a syntactically-correct QName.
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 declaredpublic NamespaceContext makeNamespaceContext()
public void processAllAttributes() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public java.lang.String getAttributeValue(java.lang.String clarkName)
public final void processAttributes() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected void checkUnknownAttribute(int nc) throws javax.xml.transform.TransformerConfigurationException
nc
- The name code of the attribute name
javax.xml.transform.TransformerConfigurationException
public abstract void prepareAttributes() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected StyleElement getLastChildInstruction()
public Expression makeExpression(java.lang.String expression) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public Pattern makePattern(java.lang.String pattern) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public Expression makeAttributeValueTemplate(java.lang.String expression) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public SequenceType makeSequenceType(java.lang.String sequenceType) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected void processExtensionElementAttribute(java.lang.String nc) throws javax.xml.transform.TransformerConfigurationException
nc
- the Clark name of the attribute required
javax.xml.transform.TransformerConfigurationException
protected void processExcludedNamespaces(java.lang.String nc) throws javax.xml.transform.TransformerConfigurationException
nc
- the Clark name of the attribute required
javax.xml.transform.TransformerConfigurationException
protected void processVersionAttribute(java.lang.String nc) throws javax.xml.transform.TransformerConfigurationException
nc
- the Clark name of the attribute required
javax.xml.transform.TransformerConfigurationException
public java.math.BigDecimal getVersion()
public boolean forwardsCompatibleModeIsEnabled()
public boolean backwardsCompatibleModeIsEnabled()
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 testedprotected void processDefaultXPathNamespaceAttribute(java.lang.String nc) throws javax.xml.transform.TransformerConfigurationException
nc
- the Clark name of the attribute required
javax.xml.transform.TransformerConfigurationException
protected short getDefaultXPathNamespace()
public SchemaType getSchemaType(java.lang.String typeAtt) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- if the type is not declared in an
imported schema, or is not a built-in typepublic int getTypeAnnotation(SchemaType schemaType)
public void validate() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public void postValidate() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public Expression typeCheck(java.lang.String name, Expression exp) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public void allocateSlots(Expression exp)
public Pattern typeCheck(java.lang.String name, Pattern pat) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public void fixupReferences() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public Procedure getOwningProcedure()
public void validateSubtree() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected void validateChildren() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected XSLStyleSheet getPrincipalStyleSheet()
public PreparedStyleSheet getPreparedStyleSheet()
public void checkWithinTemplate() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- if not within a sequence constructorpublic void checkTopLevel() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- if not at top levelpublic void checkEmpty() throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- if it is not emptypublic void reportAbsence(java.lang.String attribute) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
- if the attribute is missingpublic ItemType getContextItemType()
public abstract Instruction compile(Executable exec) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
public Instruction[] compileChildren(Executable exec, Instruction inst) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected void setAdditionalTraceProperties(TraceInstruction trace)
protected void fallbackProcessing(Executable exec, StyleElement instruction, java.util.List list) throws javax.xml.transform.TransformerConfigurationException
instruction
- The unknown extension instructionlist
- a List to be populated with instructions. The method
creates one Block instruction for each xsl:fallback found.
javax.xml.transform.TransformerConfigurationException
protected SortKeyDefinition[] makeSortKeys()
protected AttributeSet[] getAttributeSets(java.lang.String use, java.util.List list) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected WithParam[] getWithParamInstructions(Executable exec, boolean tunnel) throws javax.xml.transform.TransformerConfigurationException
tunnel
- true if the tunnel="yes" parameters are wanted, false to get
the non-tunnel parameters
javax.xml.transform.TransformerConfigurationException
protected void compileError(javax.xml.transform.TransformerException error) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected void compileError(java.lang.String message) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected void compileWarning(java.lang.String message) throws javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerConfigurationException
protected void issueWarning(javax.xml.transform.TransformerException error)
protected void issueWarning(java.lang.String message)
public boolean isTopLevel()
public XSLVariableDeclaration bindVariable(int fingerprint) throws XPathException.Static
fingerprint
- The fingerprint of the name of the variable
XPathException.Static
- if the variable has not been declaredpublic XSLVariableDeclaration getVariableBinding(int fprint)
fprint
- The absolute name of the variable (prefixed by namespace URI)
public XSLFunction getStyleSheetFunction(int fingerprint, int arity)
fingerprint
- the fingerprint of the name of the functionarity
- 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).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |