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

> A few days ago I was asked the question as to why XSLT doesn't have an <
> xsl:else> element associated with an <xsl:if> element. I didn't have an
> explanation that seemed to me to be compelling.
> 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?

> 
> I am not asking if there is a workaround. 

Such a question would be incorrect. Any "if then else" construct has the
dangling else problem. The designers of XSLT took a correct decision,
which eliminates this problem.

> I can think of a couple in XSLT 1.0 and three in XSLT 2.0. 

Because you don't understand the real issues -- see above.

> 
> The question is why isn't there an <xsl:else> element available? 

Because the designers of the language made a correct decision.

> 
> I suppose the implicit possible follow up question, depending on the 
> weight of the answer to the first question, is why don't we add an 
> <xsl:else> element to XSLT 2.0?

Because the respected designers of the language do not want to create
intentional problems in this well-thought and elegant language.

> 
> Andrew Watt

Best regards,

Dimitre Novatchev.



__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

Received on Friday, 2 April 2004 08:50:47 UTC