[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: "Clark C. Evans" <cce@xxxxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 13:37:51 -0500 (EST)
c if then syntax
I've given a bit of thought to exsl:return and I see there
are two distinct, and perhaps seperable requirements:
 
  (a) to exit a exsl:function 'early
  (b) to allow the return of a node-set

Trying to keep them seperate, I came up with:

1.  For this discussion, assume that a function always 
    returns a node-set, aka list.  Call this growable 
    list the result-set.

2.  For normal template-style items, such as xsl:element,
    xsl:value-of, xsl:text, let the corresponding result-fragment
    be created; and then convert the result-fragment into a 
    tempoary node-set, and append the node-set to the result-set.

3.  Create a new tag, <xsl:append select="xpath" /> which will:

    (a) if the xpath type is a node-set, then it appends each
        element of the node set onto the result-set.

    (b) otherwise, a text node is appended with the string-value
        of the path expression.

4.  If execution must return 'early, then a new tag, <xsl:return /> 
    can be used to return the result-set constructed.

5.  If given a select statement, like <xsl:return select="xpath" />,
    then the xpath expression selected will be returned instead
    of the result-set being constructed.

Thoughts?  Certainly this will not stand muster as a serious
proposal... it is just a few ideas jotted down.  It is 
an attempt at the "accumulator" pattern.

Clark


 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.