if expression

It would be useful to have an if() expression in XSLT 1.1 or 2.0 as a complement to the existing <xsl:choose> construct.  So for example, if you had a transform that produced a <TD> element that
contained either "None" or the count of child element, you could do:

<TD><xsl:value-of select="if(*,count(*),'None')"/></TD>

instead of:

<xsl:choose>
	<xsl:when test="*"><TD><xsl:value-of select="count(*)"/><TD></xsl:when>
	<xsl:otherwise><TD>None</TD></xsl:otherwise>
</xsl:choose>

Received on Saturday, 3 March 2001 15:41:39 UTC