Name

xsl:when

Synopsis

<xsl:when
  test = "boolean-expression">
  <! --  template  -- >
</xsl:when>

The xsl:when element only appears as a child of an xsl:choose element.

Attribute

test, required

An XPath expression that evaluates to either true or false. The xsl:when contents are inserted into the result tree if and only if this is the first xsl:when element in the xsl:choose element whose test attribute evaluates to true.

Contents

The template to be instantiated and inserted into the result tree if the test attribute is true.

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.