xsl:when

Used within an xsl:choose element to indicate one of a number of choices.

Content: sequence-constructor
Permitted parent elements: xsl:choose

Attributes

test

expression

XPath expression. If this is the first xsl:when element within the enclosing xsl:choose whose test condition matches the current element, the content of the xsl:when element is expanded, otherwise it is ignored.

Notes on the Saxon implementation

From Saxon 10, provided syntax extensions are enabled, the xsl:when and xsl:otherwise elements allow a select attribute in place of the contained sequence constructor.

Links to W3C specifications

XSLT 2.0 Specification

XSLT 3.0 Specification

See also

xsl:choose

xsl:otherwise

xsl:if