Related Documentation
- ACX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- EX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- M Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- MX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- PTX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- SRX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- T Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
xsl:choose
Syntax
<xsl:choose>
<xsl:when test="boolean-expression">
...
</xsl:when>
<xsl:otherwise>
...
</xsl:otherwise>
</xsl:call-template>
Description
Evaluate multiple conditional tests, and execute instructions for the first test that evaluates to TRUE or execute an optional default set of instructions if all tests evaluate to FALSE. The <xsl:choose> instruction contains one or more <xsl:when> elements, each of which tests a Boolean expression. If the test evaluates to TRUE, the XSLT processor executes the instructions in the <xsl:when> element, and ignores all subsequent <xsl:when> elements. The XSLT processor processes only the instructions contained in the first <xsl:when> element whose test attribute evaluates to TRUE. If none of the <xsl:when> elements’ test attributes evaluate to TRUE, the content of the optional <xsl:otherwise> element, if one is present, is processed.
Usage Examples
See Example: Configuring Dual Routing Engines, Example: Preventing Import of the Full Routing Table, and Example: Automatically Configuring Logical Interfaces and IP Addresses.
Related Documentation
- ACX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- EX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- M Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- MX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- PTX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- SRX Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when
- T Series
- XSLT Programming Instructions Overview
- xsl:for-each
- xsl:if
- xsl:otherwise
- xsl:when