Package net.sf.saxon.expr.instruct
Class CallTemplate.CallTemplatePackage
java.lang.Object
net.sf.saxon.expr.instruct.CallTemplate.CallTemplatePackage
- All Implemented Interfaces:
TailCall
- Enclosing class:
CallTemplate
A CallTemplatePackage is an object that encapsulates the name of a template to be called,
the parameters to be supplied, and the execution context. This object can be returned as a tail
call, so that the actual call is made from a lower point on the stack, allowing a tail-recursive
template to execute in a finite stack size
-
Constructor Summary
ConstructorsConstructorDescriptionCallTemplatePackage
(Component targetComponent, ParameterSet params, ParameterSet tunnelParams, CallTemplate instruction, Outputter output, XPathContext evaluationContext) Construct a CallTemplatePackage that contains information about a call. -
Method Summary
Modifier and TypeMethodDescriptionProcess the template call encapsulated by this package.
-
Constructor Details
-
CallTemplatePackage
public CallTemplatePackage(Component targetComponent, ParameterSet params, ParameterSet tunnelParams, CallTemplate instruction, Outputter output, XPathContext evaluationContext) Construct a CallTemplatePackage that contains information about a call.- Parameters:
targetComponent
- the Template to be calledparams
- the parameters to be supplied to the called templatetunnelParams
- the tunnel parameter supplied to the called templateinstruction
- the xsl:call-template instructionoutput
- the destination for the resultevaluationContext
- saved context information from the Controller (current mode, etc) which must be reset to ensure that the template is called with all the context information intact
-
-
Method Details
-
processLeavingTail
Process the template call encapsulated by this package.- Specified by:
processLeavingTail
in interfaceTailCall
- Returns:
- another TailCall. This will never be the original call, but it may be the next recursive call. For example, if A calls B which calls C which calls D, then B may return a TailCall to A representing the call from B to C; when this is processed, the result may be a TailCall representing the call from C to D.
- Throws:
XPathException
- if a dynamic error occurs
-