W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2004

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

From: Oliver Becker <obecker@informatik.hu-berlin.de>
Date: Fri, 2 Apr 2004 16:02:15 +0200 (MEST)
Message-Id: <200404021402.i32E2FID007859@mail.informatik.hu-berlin.de>
To: public-qt-comments@w3.org, dnovatchev@yahoo.com


> > 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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:19 UTC