W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2001

if expression

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Thu, 1 Mar 2001 16:03:58 -0500 (EST)
Message-ID: <B2C1451A181BD411B88A00E018C1C19C08AAD8@THOR>
To: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
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:when test="*"><TD><xsl:value-of select="count(*)"/><TD></xsl:when>
Received on Saturday, 3 March 2001 15:41:39 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:21 UTC