Package org.apache.xalan.templates
Class ElemTemplate
java.lang.Object
org.apache.xml.utils.UnImplNode
org.apache.xalan.templates.ElemTemplateElement
org.apache.xalan.templates.ElemTemplate
- All Implemented Interfaces:
Serializable
,SourceLocator
,XSLTVisitable
,PrefixResolver
,ExpressionNode
,WhitespaceStrippingElementMatcher
,Document
,Element
,Node
,NodeList
- Direct Known Subclasses:
ElemExsltFunction
,WhiteSpaceInfo
Implement xsl:template.
<!ELEMENT xsl:template (#PCDATA %instructions; %result-elements; | xsl:param) > <!ATTLIST xsl:template match %pattern; #IMPLIED name %qname; #IMPLIED priority %priority; #IMPLIED mode %qname; #IMPLIED %space-att; >
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
The stack frame size for this template, which is equal to the maximum number of params and variables that can be declared in the template at one time.Fields inherited from interface org.w3c.dom.Node
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
compose
(StylesheetRoot sroot) This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition.void
endCompose
(StylesheetRoot sroot) This after the template's children have been composed.void
execute
(TransformerImpl transformer) Copy the template contents into the result tree.getMatch()
Get the "match" attribute.getMode()
Get the "mode" attribute.getName()
Get the "name" attribute.Return the node name.double
Get the "priority" attribute.Return the public identifier for the current document event.Get the owning stylesheet.Get the stylesheet composed (resolves includes and imports and has methods on it that return "composed" properties.Get the root stylesheet.Return the system identifier for the current document event.int
Get an int constant identifying the type of element.void
recompose
(StylesheetRoot root) This function is called during recomposition to control how this element is composed.void
setLocaterInfo
(SourceLocator locator) Set the location information for this element.void
Set the "match" attribute.void
Set the "mode" attribute.void
Set the "name" attribute.void
setPriority
(double v) Set the "priority" attribute.void
setStylesheet
(Stylesheet sheet) Set the owning stylesheet.Methods inherited from class org.apache.xalan.templates.ElemTemplateElement
appendChild, appendChild, callVisitors, canAcceptVariables, canStripWhiteSpace, compareTo, containsExcludeResultPrefix, error, error, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, getBaseIdentifier, getChildNodes, getColumnNumber, getDeclaredPrefixes, getDOMBackPointer, getEndColumnNumber, getEndLineNumber, getFirstChild, getFirstChildElem, getLastChild, getLastChildElem, getLength, getLineNumber, getLocalName, getNamespaceForPrefix, getNamespaceForPrefix, getNextSibling, getNextSiblingElem, getNodeType, getOwnerDocument, getOwnerXSLTemplate, getParentElem, getParentNode, getParentNodeElem, getPreviousSibling, getPreviousSiblingElem, getTagName, getUid, getXmlSpace, handlesNullPrefixes, hasChildNodes, hasTextLitOnly, hasVariableDecl, insertBefore, isCompiledTemplate, item, removeChild, replaceChild, replaceChild, resolvePrefixTables, runtimeInit, setDOMBackPointer, setEndLocaterInfo, setParentElem, setPrefixes, setPrefixes, setUid, setXmlSpace, shouldStripWhiteSpace
Methods inherited from class org.apache.xml.utils.UnImplNode
adoptNode, appendData, cloneNode, compareDocumentPosition, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, getActualEncoding, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getBaseURI, getDoctype, getDocumentElement, getDocumentURI, getDomConfig, getElementById, getElementsByTagName, getElementsByTagNameNS, getFeature, getImplementation, getInputEncoding, getNamespaceURI, getNodeValue, getOwnerElement, getPrefix, getSchemaTypeInfo, getSpecified, getStrictErrorChecking, getTextContent, getUserData, getWholeText, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttribute, hasAttributeNS, hasAttributes, importNode, insertData, isDefaultNamespace, isEqualNode, isId, isSameNode, isSupported, isWhitespaceInElementContent, lookupNamespaceURI, lookupPrefix, normalize, normalizeDocument, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, renameNode, replaceData, replaceWholeText, setActualEncoding, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setDocumentURI, setIdAttribute, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setInputEncoding, setNodeValue, setPrefix, setStrictErrorChecking, setTextContent, setUserData, setValue, setXmlEncoding, setXmlStandalone, setXmlVersion, splitText, substringData
-
Field Details
-
m_frameSize
public int m_frameSizeThe stack frame size for this template, which is equal to the maximum number of params and variables that can be declared in the template at one time.
-
-
Constructor Details
-
ElemTemplate
public ElemTemplate()
-
-
Method Details
-
getPublicId
Return the public identifier for the current document event.This will be the public identifier
- Specified by:
getPublicId
in interfaceSourceLocator
- Overrides:
getPublicId
in classElemTemplateElement
- Returns:
- A string containing the public identifier, or null if none is available.
- See Also:
-
getSystemId
Return the system identifier for the current document event.If the system identifier is a URL, the parser must resolve it fully before passing it to the application.
- Specified by:
getSystemId
in interfaceSourceLocator
- Overrides:
getSystemId
in classElemTemplateElement
- Returns:
- A string containing the system identifier, or null if none is available.
- See Also:
-
setLocaterInfo
Set the location information for this element.- Overrides:
setLocaterInfo
in classElemTemplateElement
- Parameters:
locator
- SourceLocator holding location information
-
getStylesheetComposed
Get the stylesheet composed (resolves includes and imports and has methods on it that return "composed" properties.- Overrides:
getStylesheetComposed
in classElemTemplateElement
- Returns:
- The stylesheet composed.
-
getStylesheet
Get the owning stylesheet.- Overrides:
getStylesheet
in classElemTemplateElement
- Returns:
- The owning stylesheet.
-
setStylesheet
Set the owning stylesheet.- Parameters:
sheet
- The owning stylesheet for this element
-
getStylesheetRoot
Get the root stylesheet.- Overrides:
getStylesheetRoot
in classElemTemplateElement
- Returns:
- The root stylesheet for this element
-
setMatch
Set the "match" attribute. The match attribute is a Pattern that identifies the source node or nodes to which the rule applies. The match attribute is required unless the xsl:template element has a name attribute (see [6 Named Templates]). It is an error for the value of the match attribute to contain a VariableReference.- Parameters:
v
- Value to set for the "match" attribute- See Also:
-
getMatch
Get the "match" attribute. The match attribute is a Pattern that identifies the source node or nodes to which the rule applies. The match attribute is required unless the xsl:template element has a name attribute (see [6 Named Templates]). It is an error for the value of the match attribute to contain a VariableReference.- Returns:
- Value of the "match" attribute
- See Also:
-
setName
Set the "name" attribute. An xsl:template element with a name attribute specifies a named template. If an xsl:template element has a name attribute, it may, but need not, also have a match attribute.- Parameters:
v
- Value to set the "name" attribute- See Also:
-
getName
Get the "name" attribute. An xsl:template element with a name attribute specifies a named template. If an xsl:template element has a name attribute, it may, but need not, also have a match attribute.- Returns:
- Value of the "name" attribute
- See Also:
-
setMode
Set the "mode" attribute. Modes allow an element to be processed multiple times, each time producing a different result. If xsl:template does not have a match attribute, it must not have a mode attribute.- Parameters:
v
- Value to set the "mode" attribute- See Also:
-
getMode
Get the "mode" attribute. Modes allow an element to be processed multiple times, each time producing a different result. If xsl:template does not have a match attribute, it must not have a mode attribute.- Returns:
- Value of the "mode" attribute
- See Also:
-
setPriority
public void setPriority(double v) Set the "priority" attribute. The priority of a template rule is specified by the priority attribute on the template rule. The value of this must be a real number (positive or negative), matching the production Number with an optional leading minus sign (-).- Parameters:
v
- The value to set for the "priority" attribute- See Also:
-
getPriority
public double getPriority()Get the "priority" attribute. The priority of a template rule is specified by the priority attribute on the template rule. The value of this must be a real number (positive or negative), matching the production Number with an optional leading minus sign (-).- Returns:
- The value of the "priority" attribute
- See Also:
-
getXSLToken
public int getXSLToken()Get an int constant identifying the type of element.- Overrides:
getXSLToken
in classElemTemplateElement
- Returns:
- The token ID for the element
- See Also:
-
getNodeName
Return the node name.- Specified by:
getNodeName
in interfaceNode
- Overrides:
getNodeName
in classElemTemplateElement
- Returns:
- The element's name
-
compose
This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition.- Overrides:
compose
in classElemTemplateElement
- Throws:
TransformerException
-
endCompose
This after the template's children have been composed.- Overrides:
endCompose
in classElemTemplateElement
- Throws:
TransformerException
-
execute
Copy the template contents into the result tree. The content of the xsl:template element is the template that is instantiated when the template rule is applied.- Overrides:
execute
in classElemTemplateElement
- Parameters:
transformer
- non-null reference to the the current transform-time state.- Throws:
TransformerException
-
recompose
This function is called during recomposition to control how this element is composed.- Overrides:
recompose
in classElemTemplateElement
- Parameters:
root
- The root stylesheet for this transformation.
-