Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    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.

    Published: 2013-03-05