Visit Mozilla.org

XSLT:choose

From MDC

XSLT/XPath Reference: XSLT elements, EXSLT functions, XPath functions, XPath axes

Contents

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

[edit] 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>

[edit] Required Attributes

None.

[edit] Optional Attributes

None.

[edit] Type

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

[edit] Defined

XSLT, section 9.2.

[edit] Gecko support

Supported.