else

Syntax

else {
    /* code */
}
 
else {
    if (expression) {
        /* code */
    }
}

Description

Include the instructions that are processed if none of the expressions defined in the test attributes of the if statement evaluate as TRUE.

if (starts-with(name, "fe-")) {
    if (mtu < 1500) {
        /* Select the Fast Ethernet interfaces with low MTUs */
    }
}
else {
    if (mtu > 8096) {
        /* Select the non-Fast Ethernet interfaces with high MTUs */
    }
}
<xsl:choose>
    <xsl:when select="starts-with(name, 'fe-')">
        <xsl:if test="mtu &lt; 1500">
            <!-- Select with Fast Ethernet interfaces with low MTUs -->
        </xsl:if>
    </xsl:when>
    <xsl:otherwise>
        <xsl:if test="mtu &gt; 8096">
            <!-- Select the non-Fast Ethernet interfaces with high MTUs -->
        </xsl:if>
    </xsl:otherwise>
</xsl:choose>

See Example: Configuring Dual Routing Engines and Example: Automatically Configuring Logical Interfaces and IP Addresses.

Related Topics