net.sf.saxon.instruct
public class Template extends Procedure implements RuleTarget
Constructor Summary | |
---|---|
Template()
Create a template |
Method Summary | |
---|---|
void | apply(XPathContextMajor context)
Process the template, without returning any tail calls. |
TailCall | applyLeavingTail(XPathContextMajor context)
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. |
TailCall | expand(XPathContext context)
Expand the template. |
void | explain(ExpressionPresenter presenter)
Output diagnostic explanation to an ExpressionPresenter |
int | getConstructType()
Get the type of construct. |
LocalParam | getLocalParam(int id)
Get the local parameter with a given parameter id |
Pattern | getMatchPattern()
Get the match pattern used with this template |
int | getMinImportPrecedence()
Get the minimum import precedence used by xsl:apply-imports |
StructuredQName | getObjectName()
Get a name identifying the object of the expression, for example a function name, template name,
variable name, key name, element name, etc. |
int | getPrecedence()
Get the import precedence of the template |
SequenceType | getRequiredType()
Get the required type to be returned by this template |
StructuredQName | getTemplateName()
Get the name of the template (if it is named) |
boolean | hasRequiredParams()
Ask whether this template has one or more required parameters |
void | init(StructuredQName templateName, int precedence, int minImportPrecedence)
Initialize the template |
boolean | isStreamable()
Ask whether or not this template is declared as streamable |
void | setBody(Expression body)
Set the expression that forms the body of the template |
void | setHasRequiredParams(boolean has)
Set whether this template has one or more required parameters |
void | setMatchPattern(Pattern pattern)
Set the match pattern used with this template |
void | setRequiredType(SequenceType type)
Set the required type to be returned by this template |
void | setStreamable(boolean streamable)
Say whether or not this template is declared as streamable |
Parameters: context The dynamic context, giving access to the current node,
Parameters: context the XPath dynamic context
Returns: 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
Parameters: context the XPath dynamic context
Returns: 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
Parameters: id the parameter id
Returns: the local parameter with this id if found, otherwise null
Returns: the match pattern, or null if this is a named template with no match pattern
Returns: the minimum import precedence of templates that are candidates for calling by apply-imports
Returns: the import precedence (a higher number means a higher precedence)
Returns: the required type as defined in the "as" attribute on the xsl:template element
Returns: the template name, or null if unnamed
Returns: true if this template has at least one required parameter
Parameters: templateName the name of the template (if any) precedence the import precedence minImportPrecedence the minimum import precedence to be considered in the search performed by apply-imports
Returns: true if the template belongs to a streamable mode
Parameters: body the body of the template
Parameters: has true if the template has at least one required parameter
Parameters: pattern the match pattern (may be null for a named template)
Parameters: type the required type as defined in the "as" attribute on the xsl:template element
Parameters: streamable true if the template belongs to a streamable mode