Class CallTemplate.CallTemplatePackage

java.lang.Object
net.sf.saxon.expr.instruct.CallTemplate.CallTemplatePackage
All Implemented Interfaces:
TailCall
Enclosing class:
CallTemplate

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 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 called
      params - the parameters to be supplied to the called template
      tunnelParams - the tunnel parameter supplied to the called template
      instruction - the xsl:call-template instruction
      output - the destination for the result
      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 Details

    • processLeavingTail

      public TailCall processLeavingTail() throws XPathException
      Process the template call encapsulated by this package.
      Specified by:
      processLeavingTail in interface TailCall
      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