Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

The <xsl:choose> element defines a choice among a number of alternatives. It behaves like a switch statement in procedural languages.

Syntax

<xsl:choose>
    <xsl:when test="[whatever to test1]"></xsl:when>
    <xsl:when test="[whatever to test2]"></xsl:when>
    <xsl:otherwise></xsl:otherwise> [optional]
</xsl:choose>

Required Attributes

None.

Optional Attributes

None.

Type

Instruction, appears with a template. It contains one or more <xsl:when> elements, and, optionally, a final <xsl:otherwise> element.

Defined

XSLT, section 9.2.

Gecko support

Supported.

Document Tags and Contributors

 Contributors to this page: Sheppy, Diablownik, Firefox3107, Fredchat, Mgjbot, Ptak82, Nickolay, CitizenK, Dria
 Last updated by: Sheppy,