2.7.11 Conditionals Issue if-when-unify

Subject: 2.7.11 Conditionals Issue if-when-unify
From: Francois Belanger <francois@xxxxxxxxxxx>
Date: Wed, 23 Dec 98 12:10:49 -0500
I think they sould become one and I'd go with xsl:if (with added  
xsl:else-if and xsl:else) as often we need an if/else statement which can 
be shorter and more readable than the equivalent xsl:choose.

Example:

<xsl:choose>
 <xsl:when test=".[last-of-any()]"><xsl:value-of 
select="@name"/></xsl:when>
 <xsl:otherwise><xsl:value-of select="@name"/>,</xsl:otherwise>
 </xsl:choose>

Would become (but as I type this I realize it might make parsing 
difficult):

 <xsl:if test=".[last-of-any()]"><xsl:value-of select="@name"/></xsl:if>
 <xsl:else><xsl:value-of select="@name"/>,</xsl:else>

Anyhow,  I would not mind keeping only xsl:choose, but not both. I find 
an xsl:if without an xsl:else (which means rewriting the whole thing as a 
xsl:choose because I need to add an else) not intuitive.



 

Francois Belanger
Sitepak, Bringing Internet Business into Focus
http://www.sitepak.com



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread