[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Feature Request: a fail condition for <xsl:if>

Subject: Re: Feature Request: a fail condition for <xsl:if>
From: Eduardo Gutentag <Eduardo.Gutentag@xxxxxxxxxxx>
Date: Tue, 12 Jan 1999 14:49:22 -0800 (PST)
xsl if test else
If you look at the issues in http://www.w3.org/TR/1998/WD-xsl-19981216.html
(2.7.11.1) you'll see this is already an issue. Some time ago I proposed
to the WG to use either if or when, but not both, so that
you could use
<xsl:when> or 
<xsl:choose>
	<xsl:when></xslwhen>
	<xsl:when></xsl:when>
	<xsl:otherwise></xsl:otherwise>
</xsl:choose>

(or use if instead of when above). This, and your proposal, I'm sure,
will be discussed shortly.

BTW - I much prefer when and otherwise to avoid any confusion as to
the ifelse-ness of a repeated when inside choose.

Eduardo


>----- Begin Included Message -----<

Date: Tue, 12 Jan 1999 16:30:50 -0500
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Subject: Feature Request: a fail condition for <xsl:if>
To: "XSL List" <xsl-list@xxxxxxxxxxxxxxxx>

I'd like to see the use of <xsl:otherwise> as an "else" in the <xsl:if>
test construct:

    <xsl:if test="">
      ...
      <xsl:otherwise>
        ...
      </xsl:otherwise>
    </xsl:if>

As well, a backward incompatible change would be to rename <xsl:otherwise>
to <xsl:else>, then we would have:

    <xsl:choose>
      <xsl:when test="">
        ...
      </xsl:when>
      <xsl:when test="">
        ...
      </xsl:when>
      <xsl:when test="">
        ...
      </xsl:when>
      <xsl:else>
        ...
      </xsl:else>
    </xsl:choose>

  and

    <xsl:if test="">
      ...
      <xsl:otherwise>
        ...
      </xsl:otherwise>
    </xsl:if>

Alternatively (no pun intended), perhaps just remove the existing <xsl:if>
construct entirely and force people to use <xsl:choose>, substituting the
existing "when" with "if":

    <xsl:choose>
      <xsl:if test="">
        ...
      </xsl:if>
      <xsl:if test="">
        ...
      </xsl:if>
      <xsl:if test="">
        ...
      </xsl:if>
      <xsl:else>
        ...
      </xsl:else>
    </xsl:choose>

The above gives the impression, I feel, of a if-elseif-elseif-else block.

I think that having an "if" without an "else" will be confusing to people,
and perhaps just recasting the current "choose" construct into a multi-part
"if" construct will suffice.

............ Ken

--
G. Ken Holman         mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/s/
Training:   http://www.CraneSoftwrights.com/s/schedule.htm
Resources: http://www.CraneSoftwrights.com/s/resources.htm
Shareware: http://www.CraneSoftwrights.com/s/shareware.htm
Next XSL Training (see training link):   WWW8 - 1999-05-11


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

>----- End Included Message -----<


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.