net.sf.saxon.instruct
Class Choose
java.lang.Object
net.sf.saxon.instruct.Instruction
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
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 |
Choose
public Choose(Expression[] conditions,
Instruction[] actions)
- Construct an xsl:choose instruction
- Parameters:
conditions
- the conditions to be tested, in orderactions
- the actions to be taken when the corresponding condition is true
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
- Returns:
- the string "xsl:if" or "xsl:choose". We assume that if there was
only one condition then it was an xsl:if; this is not necessarily so, but
it's adequate for tracing purposes.
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