net.sf.saxon.instruct
public class ApplyTemplates extends Instruction
Field Summary | |
---|---|
protected WithParam[] | actualParams |
protected boolean | implicitSelect |
protected Mode | mode |
protected Expression | select |
protected WithParam[] | tunnelParams |
protected boolean | useCurrentMode |
protected boolean | useTailRecursion |
Constructor Summary | |
---|---|
protected | ApplyTemplates() |
ApplyTemplates(Expression select, boolean useCurrentMode, boolean useTailRecursion, Mode mode, boolean implicitSelect)
Construct an apply-templates instructino |
Method Summary | |
---|---|
protected TailCall | apply(XPathContext context, boolean returnTailCall) |
static TailCall | applyTemplates(SequenceIterator iterator, Mode mode, ParameterSet parameters, ParameterSet tunnelParameters, XPathContextMajor context, int locationId)
Process selected nodes using the handlers registered for a particular
mode.
|
Expression | copy()
Copy an expression. |
boolean | createsNewNodes()
Determine whether this instruction creates new nodes.
|
static void | defaultAction(NodeInfo node, ParameterSet parameters, ParameterSet tunnelParams, XPathContext context, int locationId)
Perform the built-in template action for a given node.
|
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
WithParam[] | getActualParams()
Get the actual parameters passed to the called template |
int | getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes |
Mode | getMode()
Get the Mode |
Expression | getSelectExpression()
Get the select expression |
WithParam[] | getTunnelParams()
Get the tunnel parameters passed to the called template |
boolean | hasLoopingSubexpression(Expression child)
Given an expression that is an immediate child of this expression, test whether
the evaluation of the parent expression causes the child expression to be
evaluated repeatedly |
protected void | init(Expression select, boolean useCurrentMode, boolean useTailRecursion, Mode mode, boolean implicitSelect) |
boolean | isImplicitSelect()
Ask if the select expression was implicit |
Iterator<Expression> | iterateSubExpressions()
Get all the XPath expressions associated with this instruction
(in XSLT terms, the expression present on attributes of the instruction,
as distinct from the child instructions in a sequence construction) |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType) |
void | process(XPathContext context) |
TailCall | processLeavingTail(XPathContext context) |
protected void | promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites. |
boolean | replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression |
void | setActualParameters(WithParam[] actualParams, WithParam[] tunnelParams)
Set the actual parameters on the call |
Expression | simplify(ExpressionVisitor visitor)
Simplify an expression. |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType) |
boolean | usesCurrentMode()
Ask if mode="#current" was specified |
boolean | useTailRecursion()
Ask if tail recursion is to be used |
Parameters: select the select expression useCurrentMode true if mode="#current" was specified useTailRecursion true if this instruction is the last in its template mode the mode specified on apply-templates implicitSelect true if the select attribute was defaulted
Parameters: iterator an Iterator over the nodes to be processed, in the correct (sorted) order mode Identifies the processing mode. It should match the mode defined when the element handler was registered using setHandler with a mode parameter. Set this parameter to null to invoke the default mode. parameters A ParameterSet containing the parameters to the handler/template being invoked. Specify null if there are no parameters. tunnelParameters A ParameterSet containing the parameters to the handler/template being invoked. Specify null if there are no parameters. context A newly-created context object (this must be freshly created by the caller, as it will be modified by this method) locationId location of this apply-templates instruction in the stylesheet
Returns: a TailCall returned by the last template to be invoked, or null, indicating that there are no outstanding tail calls.
Throws: XPathException if any dynamic error occurs
Returns: the copy of the original expression
Parameters: node the node to be processed parameters the parameters supplied to apply-templates tunnelParams the tunnel parameters to be passed through context the dynamic evaluation context locationId location of the instruction (apply-templates, apply-imports etc) that caused the built-in template to be invoked
Throws: XPathException if any dynamic error occurs
Parameters: out output destination
Returns: the non-tunnel parameters
Returns: the mode, or null if mode="#current" was specified
Returns: the select expression
Returns: the tunnel parameters
Parameters: child the immediate subexpression
Returns: true if the child expression is evaluated repeatedly
Returns: true if no select attribute was explicitly specified
Parameters: offer The type of rewrite being offered
Throws: XPathException
Parameters: original the original subexpression replacement the replacement subexpression
Returns: true if the original subexpression is found
Parameters: actualParams represents the contained xsl:with-param elements having tunnel="no" (the default) tunnelParams represents the contained xsl:with-param elements having tunnel="yes"
Parameters: visitor the expression visitor
Returns: the simplified expression
Throws: XPathException if an error is discovered during expression rewriting
Returns: true if mode="#current" was specified
Returns: true if tail recursion is used