net.sf.saxon.instruct
Class Template
- Container, InstructionInfoProvider, Serializable, SourceLocator, LocationProvider
An xsl:template element in the style sheet.
getBody , getColumnNumber , getExecutable , getHostLanguage , getLineNumber , getLineNumber , getLocationProvider , getPublicId , getStackFrameMap , getSystemId , getSystemId , replaceSubExpression , setBody , setExecutable , setHostLanguage , setLineNumber , setStackFrameMap , setSystemId |
Template
public Template()
Create a template
apply
public void apply(XPathContext context,
Rule rule)
throws XPathException
Process the template, without returning any tail calls. This path is used by
xsl:apply-imports and xsl:next-match
context
- The dynamic context, giving access to the current node,rule
- the template rule that caused this template to be invoked. When a template has
a match pattern defined as a union, there can be more than one Rule referring to the same template,
and further calls on next-match or apply-imports need to know which one in in force
applyLeavingTail
public TailCall applyLeavingTail(XPathContext context,
Rule rule)
throws XPathException
Process this template, with the possibility of returning a tail call package if the template
contains any tail calls that are to be performed by the caller.
context
- the XPath dynamic contextrule
- the template rule that caused this template to be invoked. When a template has
a match pattern defined as a union, there can be more than one Rule referring to the same template,
and further calls on next-match or apply-imports need to know which one in in force
- null if the template exited normally; but if it was a tail call, details of the call
that hasn't been made yet and needs to be made by the caller
expand
public TailCall expand(XPathContext context)
throws XPathException
Expand the template. Called when the template is invoked using xsl:call-template.
Invoking a template by this method does not change the current template.
context
- the XPath dynamic context
- null if the template exited normally; but if it was a tail call, details of the call
that hasn't been made yet and needs to be made by the caller
getMinImportPrecedence
public int getMinImportPrecedence()
Get the minimum import precedence used by xsl:apply-imports
- the minimum import precedence of templates that are candidates for calling by apply-imports
getPrecedence
public int getPrecedence()
Get the import precedence of the template
- the import precedence (a higher number means a higher precedence)
getRequiredType
public SequenceType getRequiredType()
Get the required type to be returned by this template
- the required type as defined in the "as" attribute on the xsl:template element
getTemplateName
public StructuredQName getTemplateName()
Get the name of the template (if it is named)
- the template name, or null if unnamed
hasRequiredParams
public boolean hasRequiredParams()
Ask whether this template has one or more required parameters
- true if this template has at least one required parameter
init
public void init(StructuredQName templateName,
int precedence,
int minImportPrecedence)
Initialize the template
templateName
- the name of the template (if any)precedence
- the import precedenceminImportPrecedence
- the minimum import precedence to be considered in the search
performed by apply-imports
setBody
public void setBody(Expression body)
Set the expression that forms the body of the template
- setBody in interface Procedure
body
- the body of the template
setHasRequiredParams
public void setHasRequiredParams(boolean has)
Set whether this template has one or more required parameters
has
- true if the template has at least one required parameter
setRequiredType
public void setRequiredType(SequenceType type)
Set the required type to be returned by this template
type
- the required type as defined in the "as" attribute on the xsl:template element