xsl:choose

Syntax

<xsl:choose>
    <xsl:when test="boolean-expression">
...
    </xsl:when>
    <xsl:otherwise>
...
    </xsl:otherwise>
</xsl:call-template>

Description

Express multiple conditional tests. The <xsl:choose> instruction contains one or more <xsl:when> elements, each of which tests an XPath expression. If the test evaluates as TRUE, the XSLT processor executes the instructions in the <xsl:when> element. The XSLT processor processes only the instructions contained in the first <xsl:when> element whose test attribute evaluates as TRUE. If none of the <xsl:when> elements’ test attributes evaluate as TRUE, the content of the <xsl:otherwise> element, if there is one, is processed.

See Example: Configuring Dual Routing Engines, Example: Preventing Import of the Full Routing Table, and Example: Automatically Configuring Logical Interfaces and IP Addresses.

Related Topics