Name

xsl:choose

Synopsis

<xsl:choose>
  <! --  (xsl:when+, xsl:otherwise?)  -- >
</xsl:choose>

The xsl:choose element selects one (or none) of a sequence of alternatives.

Contents

This element contains one or more xsl:when elements, each of which has a test condition. The contents of the first xsl:when child whose test condition is true are output.

The xsl:choose element may have an optional xsl:otherwise element whose contents are output only if none of the test conditions in any of the xsl:when elements is true.

If the xsl:choose does not have an xsl:otherwise child element, and none of the test conditions in any of the xsl:when child elements is true, then this element does not produce output.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.