The XSLT <xsl:when> element provides a conditional test to use against the contents of an XML file within the scope a larger <xsl:choose> conditional evaluation.
<xsl:when> supports one attribute – test – which must return a Boolean value (true or false) through the application of a XPATH expression, or evaluation of a variable.
The <xsl:when> element cannot be used on its own; it must always be used together with the <xsl:choose> element. When used inside an <xsl:choose> then only the first <xsl:when> whose test evaluates to true will be processed.
If your intention is to evaluate a simple Boolean expression (and not a sequence of alternatives) and nothing else, then look into using the <xsl:if> element instead.
<xsl:choose> contains one or more nested <xsl:when> elements and one optional <xsl:otherwise> element. Only the contents one <xsl:when> element is evaluated when its corresponding expression returns true; otherwise the <xsl:otherwise> content is evaluated if defined.
|test||MANDATORY||an XPATH expression or variable reference which returns / represents a Boolean value (true or false).|