net.sf.saxon.instruct
Class Choose

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

public class Choose
extends Instruction

Compiled representation of an xsl:choose or xsl:if element in the stylesheet.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.instruct.Instruction
children
 
Constructor Summary
Choose(Expression[] conditions, Instruction[] actions)
          Construct an xsl:choose instruction
 
Method Summary
 TailCall processLeavingTail(XPathContext context)
          Process this instruction, that is, choose an xsl:when or xsl:otherwise child and process it.
 void setInstructionDetails(Controller controller, NamePool namePool, InstructionDetails details)
          Get the name of this instruction for diagnostic and tracing purposes
 
Methods inherited from class net.sf.saxon.instruct.Instruction
assembleParams, assembleTunnelParams, getChildren, getColumnNumber, getInstructionDetails, getInstructionName, getLineNumber, getPublicId, getResultType, getSystemId, getSystemId, process, 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

Choose

public Choose(Expression[] conditions,
              Instruction[] actions)
Construct an xsl:choose instruction

Parameters:
conditions - the conditions to be tested, in order
actions - the actions to be taken when the corresponding condition is true
Method Detail

setInstructionDetails

public void setInstructionDetails(Controller controller,
                                  NamePool namePool,
                                  InstructionDetails details)
Get the name of this instruction for diagnostic and tracing purposes

Specified by:
setInstructionDetails in class Instruction

processLeavingTail

public TailCall processLeavingTail(XPathContext context)
                            throws TransformerException
Process this instruction, that is, choose an xsl:when or xsl:otherwise child and process it.

Specified by:
processLeavingTail in class Instruction
Parameters:
context - the dynamic context of this transformation
Returns:
a TailCall, if the chosen branch ends with a call of call-template or apply-templates. It is the caller's responsibility to execute such a TailCall. If there is no TailCall, returns null.
Throws:
TransformerException - if any non-recoverable dynamic error occurs