applyTemplates
public static TailCall applyTemplates(SequenceIterator iterator,
Mode mode,
ParameterSet parameters,
ParameterSet tunnelParameters,
XPathContextMajor context,
boolean backwardsCompatible,
int locationId)
throws XPathException
Process selected nodes using the handlers registered for a particular
mode.
iterator
- an Iterator over the nodes to be processed, in the
correct (sorted) ordermode
- 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)backwardsCompatible
- true if running in backwards compatibility modelocationId
- location of this apply-templates instruction in the stylesheet
- a TailCall returned by the last template to be invoked, or null,
indicating that there are no outstanding tail calls.
copy
public Expression copy()
Copy an expression. This makes a deep copy.
- copy in interface Expression
- the copy of the original expression
createsNewNodes
public final boolean createsNewNodes()
Determine whether this instruction creates new nodes.
This implementation returns true (which is almost invariably the case, so it's not worth
doing any further analysis to find out more precisely).
- createsNewNodes in interface Instruction
defaultAction
public static void defaultAction(NodeInfo node,
ParameterSet parameters,
ParameterSet tunnelParams,
XPathContext context,
boolean backwardsCompatible,
int locationId)
throws XPathException
Perform the built-in template action for a given node.
node
- the node to be processedparameters
- the parameters supplied to apply-templatestunnelParams
- the tunnel parameters to be passed throughcontext
- the dynamic evaluation contextbackwardsCompatible
- true if in 1.0 mode (currently makes no difference)locationId
- location of the instruction (apply-templates, apply-imports etc) that caused
the built-in template to be invoked
explain
public void explain(ExpressionPresenter out)
Diagnostic print of expression structure. The abstract expression tree
is written to the supplied output destination.
- explain in interface Expression
getInstructionNameCode
public int getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
- getInstructionNameCode in interface Instruction
getSelectExpression
public Expression getSelectExpression()
Get the select expression
hasLoopingSubexpression
public 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
- hasLoopingSubexpression in interface Expression
child
- the immediate subexpression
- true if the child expression is evaluated repeatedly
iterateSubExpressions
public Iterator 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)
- iterateSubExpressions in interface Expression
replaceSubExpression
public boolean replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression
- replaceSubExpression in interface Expression
original
- the original subexpressionreplacement
- the replacement subexpression
- true if the original subexpression is found
setActualParameters
public void setActualParameters(WithParam[] actualParams,
WithParam[] tunnelParams)
Set the actual parameters on the call
actualParams
- represents the contained xsl:with-param elements having tunnel="no" (the default)tunnelParams
- represents the contained xsl:with-param elements having tunnel="yes"