Re: Designs for XSLT functions (Was: Re: [xsl] RE: syntax sugar for call-template)

Subject: Re: Designs for XSLT functions (Was: Re: [xsl] RE: syntax sugar for call-template)
From: Uche Ogbuji <uche.ogbuji@xxxxxxxxxxxxxxx>
Date: Wed, 28 Feb 2001 11:07:35 -0700
> Hi Clark,
> 
> > Not a very good example... but then again, I was trying to think of
> > a syntax that would allow a node set to be built-up over the course
> > of the function, and <exsl:return ... /> does not do this.
> 
> I did come up with a use case that I think touches on what you're
> talking about here, namely returning the first five nodes in an
> alphabetical sort of a node set.
> 
> <xsl:variable select="my:first-alphabetically($nodes, 5)" />

Well, this could be handled by an exsl:slice() function:

exsl:slice($nodes, 1, 5)

Would return the first 5 nodes of $node, using the same ordering as used by 
<for-each select="">

I personally think that broad node-set operators would make up a more general 
facility than an "append-only-to-the-result" facility.


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