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

This is a silly discussion, I believe ...
However, here are my two cents again

> This is how I understand the question of Mike Kay:
> 
> "How would you associate the <xsl:else> with the <xsl:if>? Perhaps by
> wrapping both of them in an <xsl:choose>?"

Answer: the first preceding sibling of xsl:else has to be an xsl:if
(after stripping whitespace).
The inconvenience of checking where the xsl:else belongs to is purely
the point of view of the implementor. For the user this is very simple
to understand and to write.

<xsl:if/><xsl:else/>
would be simply an abbreviation for
<xsl:choose><xsl:when/><xsl:otherwise/></xsl:choose>
just as @foo is an abbreviation for attribute::foo

So I think there are no factual reasons against xsl:else,
some people like it (as me for example), others don't (as you and Mike
Kay). That's all.

Best regards,
Oliver

Received on Saturday, 3 April 2004 11:12:50 UTC