Re: [XSLT 2.0] Why doesn't XSLT have an <xsl:else> element?

> > Is there a good reason for the absence of <xsl:else>?
> 
> Yes and you could have tried to think about it. How would you solve the
> "dangling else" problem?

Dimitre,

since the W3C doesn't want to add xsl:else, this discussion might be
pointless. However: requiring that xsl:else must always follow immediately
an xsl:if is IMHO not more complicate than requiring that xsl:param must
always come first within a template.

Moreover, there is no dangling else here:

if x then (if y then a else b)
becomes
<xsl:if test="x">
   <xsl:if test="y">a</xsl:if>
   <xsl:else>b</xsl:else>
</xsl:if>

if x then (if y then a) else b
becomes
<xsl:if test="x">
   <xsl:if test="y">a</xsl:if>
</xsl:if>
<xsl:else>b</xsl:else>
     
Regards,
Oliver Becker


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@informatik.hu-berlin.de             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/

Received on Friday, 2 April 2004 09:02:36 UTC