To add an xsl:choose statement using the context menu:
-
Right-click the target node and select Add XSL Instruction -> choose from the context menu that appears.
A choose statement is added as the parent node of the target node along with an
xsl:whenstatement. Figure 41-15 shows the result of adding thexsl:choosestatement to the AccountNumber node.Figure 41-15 Adding an xsl:choose Statement

Description of "Figure 41-15 Adding an xsl:choose Statement"An
xsl:choosestatement can contain multiplexsl:whenstatements followed by an optionalxsl:otherwisestatement. -
To add an
xsl:otherwisenode to the xsl:choose node, right-click xsl:choose in the target tree and select Add XSL Instruction -> otherwise from the context menu that appears.Figure 41-16 shows the result of adding the
xsl:otherwisestatement to thexsl:choosestatement. Note that the AccountNumber node is copied to each section of thexsl:choosestatement.Figure 41-16 Adding an xsl:otherwise Statement to an xsl:choose Statement

Description of "Figure 41-16 Adding an xsl:otherwise Statement to an xsl:choose Statement" -
Map the
xsl:whennode to the source node whose existence is to be tested. In our current example, you drag a line from the HQAccount node in the source to the xsl:when node in the target. -
Map the xsl:when and xsl:otherwise cases. In the current example, you drag a line from the HQAccount/AccountNumber node to the xsl:choose/xsl:when/AccountNumber node. Similarly, you drag a line from the BranchAccount/AccountNumber node to the xsl:choose/xsl:otherwise/AccountNumber node.
Figure 41-17 shows the completed
xsl:chooseconstruct.
