net.sf.saxon.instruct
Class CallTemplate

java.lang.Object
  extended by net.sf.saxon.instruct.Instruction
      extended by net.sf.saxon.instruct.CallTemplate
All Implemented Interfaces:
Serializable, SourceLocator

public class CallTemplate
extends Instruction

Instruction representing an xsl:call-template element in the stylesheet.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.instruct.Instruction
children
 
Constructor Summary
CallTemplate(Template template, WithParam[] actualParams, WithParam[] tunnelParams, boolean useTailRecursion, Expression calledTemplateExpression, NamespaceResolver nsContext)
          Construct a CallTemplate instruction.
 
Method Summary
 void process(XPathContext context)
          Process this instruction, without leaving any tail calls.
 TailCall processLeavingTail(XPathContext context)
          Process this instruction.
 void setInstructionDetails(Controller controller, NamePool namePool, InstructionDetails details)
          Return the name of this instruction.
 
Methods inherited from class net.sf.saxon.instruct.Instruction
assembleParams, assembleTunnelParams, getChildren, getColumnNumber, getInstructionDetails, getInstructionName, getLineNumber, getPublicId, getResultType, getSystemId, getSystemId, processChildren, processChildrenLeavingTail, recoverableError, setChildren, setSourceLocation, styleError, styleError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallTemplate

public CallTemplate(Template template,
                    WithParam[] actualParams,
                    WithParam[] tunnelParams,
                    boolean useTailRecursion,
                    Expression calledTemplateExpression,
                    NamespaceResolver nsContext)
Construct a CallTemplate instruction.

Parameters:
template - the Template object identifying the template to be called, in the normal case where this is known statically
actualParams - array of WithParam instructions to calculate the actual parameters to be supplied to the call
calledTemplateExpression - expression to calculate the name of the template to be called at run-time, this supports the saxon:allow-avt option
nsContext - the static namespace context of the instruction, needed only in the case where the name of the called template is to be calculated dynamically
Method Detail

setInstructionDetails

public void setInstructionDetails(Controller controller,
                                  NamePool namePool,
                                  InstructionDetails details)
Return the name of this instruction.

Specified by:
setInstructionDetails in class Instruction

process

public void process(XPathContext context)
             throws TransformerException
Process this instruction, without leaving any tail calls.

Overrides:
process in class Instruction
Parameters:
context - the dynamic context for this transformation
Throws:
TransformerException - if a dynamic error occurs

processLeavingTail

public TailCall processLeavingTail(XPathContext context)
                            throws TransformerException
Process this instruction. If the called template contains a tail call (which may be an xsl:call-template of xsl:apply-templates instruction) then the tail call will not actually be evaluated, but will be returned in a TailCall object for the caller to execute.

Specified by:
processLeavingTail in class Instruction
Parameters:
context - the dynamic context for this transformation
Returns:
an object containing information about the tail call to be executed by the caller. Returns null if there is no tail call.
Throws:
TransformerException