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

Re: Designs for XSLT functions (Was: Re: RE: syntax su

Subject: Re: Designs for XSLT functions (Was: Re: RE: syntax sugar for call-template)
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Mon, 19 Feb 2001 17:36:49 +0000
Re: Designs for XSLT functions (Was: Re:  RE: syntax su
Hi David,

Thanks for the input.

> <!ELEMENT xsl:function (xsl:param*, xsl:variable*, xsl:return)>

Personally, I think that this is too restrictive.  As you point out,
it makes ifs and chooses quite difficult.  I'd prefer something along
the lines of:

<!ELEMENT exsl:function (xsl:param*, (xsl:for-each | xsl:if |
                                      xsl:choose | xsl:message |
                                      xsl:fallback | exsl:return)*)>

with multiple exsl:returns allowed in different xsl:whens, for
example.
                                      
> Another thing: wouldn't <xsl:result> be a better name for
> <xsl:return> (assuming it can only appear once)? At least to me it
> sounds more declarative.

I think we've been assuming that there's more than one, as above, but
I personally have no strong feeling either way about the name.

But this sparked something for me - having an exsl:return inside a
xsl:for-each:

   <xsl:for-each select="$node">
      <xsl:if test="*">
         <exsl:return select="true()" />
      </xsl:if>
   </xsl:for-each>

(in effect equivalent to <exsl:return select="boolean($node[*])" />)

Perhaps xsl:for-each shouldn't be allowed directly within function
definitions?  Can anyone come up with a use case where it's helpful to
have it?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



 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.