[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: Uche Ogbuji <uche.ogbuji@xxxxxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 14:48:32 -0700
xsl append node
> 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.

I don't think this is necessary with an exsl:node-set().

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

Hmm.  Doesn't seem necessary in a declarative system, ecept perhaps as a 
performance hint (a la Prolog's "cut").

That's one reason I prefer "exsl:result" to "exsl:return".  It makes it easier 
not to confuse a declarative model with a procedural one.

> 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.

I can't think of any situations that the above system would enable that are 
not conveniently covered by the emerging shape of exsl:result.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@xxxxxxxxxxxxxxx               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python



 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.