com.icl.saxon.style

Class XSLTemplate

Implemented Interfaces:
DOMLocator, Element, Locator, NamedNodeMap, Node, NodeHandler, NodeInfo, Source, SourceLocator
Known Direct Subclasses:
SAXONHandler

public class XSLTemplate
extends StyleElement
implements NodeHandler

An xsl:template element in the style sheet.

Nested Class Summary

Field Summary

protected Pattern
match
protected int
modeNameCode
protected boolean
needsStackFrame
protected double
priority
protected boolean
prioritySpecified
protected Procedure
procedure
protected int
templateFingerprint

Fields inherited from class com.icl.saxon.style.StyleElement

REPORT_ALWAYS, REPORT_IF_INSTANTIATED, REPORT_UNLESS_FORWARDS_COMPATIBLE, attributeSets, extensionNamespaces, reportingCircumstances, staticContext, validationError, version

Fields inherited from class com.icl.saxon.tree.ElementWithAttributes

attributeList, namespaceList

Fields inherited from class com.icl.saxon.tree.ElementImpl

nameCode, root

Fields inherited from class com.icl.saxon.tree.ParentNodeImpl

sequence

Fields inherited from class com.icl.saxon.tree.NodeImpl

emptyArray, index, parent

Fields inherited from class com.icl.saxon.om.AbstractNode

NODE_LETTER

Fields inherited from interface com.icl.saxon.om.NodeInfo

ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, NODE, NONE, NUMBER_OF_TYPES, PI, ROOT, TEXT

Method Summary

Binding
bindVariable(int fingerprint)
Disallow variable references in the match pattern
protected void
expand(Context context)
Expand the template.
int
getMinImportPrecedence()
Procedure
getProcedure()
Get associated Procedure (for details of stack frame)
int
getTemplateFingerprint()
Return the fingerprint for the name of this template
boolean
mayContainTemplateBody()
Determine whether this type of element is allowed to contain a template-body
boolean
needsStackFrame()
void
prepareAttributes()
Set the attribute list for the element.
void
preprocess()
Preprocess: this registers the template with the rule manager, and ensures space is available for local variables
void
process(Context context)
Process template.
void
start(NodeInfo e, Context context)
Process a node in the source document.
protected void
traceExpand(Context context)
Expand the template, with tracing.
void
validate()
Check that the element is valid.

Methods inherited from class com.icl.saxon.style.StyleElement

bindVariable, checkEmpty, checkNotTopLevel, checkTopLevel, checkUnknownAttribute, checkWithinTemplate, compileError, compileError, definesExcludedNamespace, definesExtensionElement, doesPostProcessing, fallbackProcessing, findAttributeSets, forwardsCompatibleModeIsEnabled, getContainingStyleSheet, getPrecedence, getPreparedStyleSheet, getPrincipalStyleSheet, getStandardNames, getStyleSheetFunction, getVariableBinding, getVariableNames, getVersion, handleSortKeys, isExcludedNamespace, isExtensionNamespace, isInstruction, isTopLevel, makeAttributeValueTemplate, makeExpression, makePattern, mayContainTemplateBody, prepareAttributes, preprocess, process, processAllAttributes, processAttributeSets, processAttributes, processChildren, processExcludedNamespaces, processExtensionElementAttribute, processVersionAttribute, reportAbsence, setValidationError, styleError, styleError, substituteFor, validate, validateChildren, validateSubtree

Methods inherited from class com.icl.saxon.tree.ElementWithAttributes

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

Methods inherited from class com.icl.saxon.tree.ElementImpl

addNamespaceNodes, copy, copy, generateId, getAttributeList, getAttributeValue, getBaseURI, getDocumentRoot, getLineNumber, getNameCode, getNodeType, getPrefixForURI, getSystemId, getURICodeForPrefix, initialise, makeNameCode, outputNamespaceNodes, setAttribute, setLineNumber, setNameCode, setSystemId

Methods inherited from class com.icl.saxon.tree.ParentNodeImpl

addChild, compact, copyStringValue, dropChildren, enumerateChildren, getChildNodes, getFirstChild, getLastChild, getNodeValue, getNthChild, getSequenceNumber, getStringValue, hasChildNodes, removeChild, renumberChildren, useChildrenArray

Methods inherited from class com.icl.saxon.tree.NodeImpl

compareOrder, generateId, getAttributeValue, getAttributeValue, getAttributes, getBaseURI, getChildNodes, getDisplayName, getDocumentElement, getDocumentRoot, getEnumeration, getFingerprint, getFirstChild, getLastChild, getLineNumber, getLocalName, getNameCode, getNamePool, getNextInDocument, getNextSibling, getOriginatingNode, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getSequenceNumber, getSystemId, getURI, hasAttributes, hasChildNodes, isSameNode, outputNamespaceNodes, removeNode, setSystemId

Methods inherited from class com.icl.saxon.om.AbstractNode

appendChild, appendData, cloneNode, compareOrder, copyStringValue, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, generateId, getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getAttributeValue, getAttributeValue, getAttributes, getBaseURI, getChildNodes, getColumnNumber, getData, getDisplayName, getDoctype, getDocumentElement, getDocumentRoot, getElementById, getElementsByTagName, getElementsByTagNameNS, getEnumeration, getFingerprint, getFirstChild, getImplementation, getLastChild, getLength, getLineNumber, getLocalName, getName, getNameCode, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOriginatingNode, getOwnerDocument, getOwnerElement, getParent, getParentNode, getPrefix, getPreviousSibling, getPublicId, getSpecified, getSystemId, getTagName, getURI, getValue, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, importNode, insertBefore, insertData, isSameNode, isSupported, normalize, outputNamespaceNodes, removeAttribute, removeAttributeNS, removeAttributeNode, removeChild, replaceChild, replaceData, setAttributeNS, setAttributeNode, setAttributeNodeNS, setData, setNodeValue, setPrefix, setValue, splitText, substringData, supports

Field Details

match

protected Pattern match


modeNameCode

protected int modeNameCode


needsStackFrame

protected boolean needsStackFrame


priority

protected double priority


prioritySpecified

protected boolean prioritySpecified


procedure

protected Procedure procedure


templateFingerprint

protected int templateFingerprint

Method Details

bindVariable

public Binding bindVariable(int fingerprint)
            throws XPathException
Disallow variable references in the match pattern
Overrides:
bindVariable in interface StyleElement


expand

protected void expand(Context context)
            throws TransformerException
Expand the template. Called when the template is invoked either by xsl:apply-templates or from xsl:call-template


getMinImportPrecedence

public int getMinImportPrecedence()


getProcedure

public Procedure getProcedure()
Get associated Procedure (for details of stack frame)


getTemplateFingerprint

public int getTemplateFingerprint()
Return the fingerprint for the name of this template


mayContainTemplateBody

public boolean mayContainTemplateBody()
Determine whether this type of element is allowed to contain a template-body
Overrides:
mayContainTemplateBody in interface StyleElement

Returns:
true: yes, it may contain a template-body


needsStackFrame

public boolean needsStackFrame()
Specified by:
needsStackFrame in interface NodeHandler


prepareAttributes

public void prepareAttributes()
            throws 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
Overrides:
prepareAttributes in interface StyleElement


preprocess

public void preprocess()
            throws TransformerConfigurationException
Preprocess: this registers the template with the rule manager, and ensures space is available for local variables
Overrides:
preprocess in interface StyleElement


process

public void process(Context context)
            throws TransformerException
Process template. This is called while all the top-level nodes are being processed in order, so it does nothing.
Overrides:
process in interface StyleElement


start

public void start(NodeInfo e,
                  Context context)
            throws TransformerException
Process a node in the source document. This is called when the template is invoked using xsl:apply-templates.
Specified by:
start in interface NodeHandler


traceExpand

protected void traceExpand(Context context)
            throws TransformerException
Expand the template, with tracing. Called when the template is invoked either by xsl:apply-templates or from xsl:call-template


validate

public void validate()
            throws TransformerConfigurationException
Check that the 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.
Overrides:
validate in interface StyleElement