Home >
Online Product Documentation >
Table of Contents >
xsl:if and xsl:choose
xsl:if and xsl:choose
The
xsl:if
instruction cannot express an else condition. It has a single input port, and a single output port, as shown in
Figure 244.
|
Figure 244. xsl:if Instruction Block
Once fully defined, the
xsl:if
block generates code like the following:
If you need to express an else condition, use the
xsl:choose
instruction block. This instruction block has two output ports by default, one for the
xsl:when test=
attribute, and one for the one
xsl:otherwise
element.
|
Figure 245. xsl:choose Instruction Block
The
xsl:choose
instruction block generates code like the following:
If you need to define more than one
xsl:when test=
attribute, use the
xsl:choose shortcut menu (right click) and select
Add When Port.
Note
|
|
Stylus Studio generates the
xsl:otherwise element by default for all
xsl:choose instructions.
|