net.sf.saxon.instruct

Class CallTemplate.CallTemplatePackage

public static class CallTemplate.CallTemplatePackage extends Object implements TailCall

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
CallTemplatePackage(Template template, ParameterSet params, ParameterSet tunnelParams, Instruction instruction, XPathContext evaluationContext)
Construct a CallTemplatePackage that contains information about a call.
Method Summary
TailCallprocessLeavingTail()
Process the template call encapsulated by this package.

Constructor Detail

CallTemplatePackage

public CallTemplatePackage(Template template, ParameterSet params, ParameterSet tunnelParams, Instruction instruction, XPathContext evaluationContext)
Construct a CallTemplatePackage that contains information about a call.

Parameters: template the Template to be called params the parameters to be supplied to the called template tunnelParams the tunnel parameter supplied to the called template evaluationContext 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 Detail

processLeavingTail

public TailCall processLeavingTail()
Process the template call encapsulated by this package.

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