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

Re: Sorting and Grouping revisited

Subject: Re: Sorting and Grouping revisited
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Thu, 19 Apr 2001 11:03:22 +0100
Re:  Sorting and Grouping revisited

David Carlisle wrote:
> 
> > 'am I crazy for expecting XSLT to be able to handle sorting and
> > grouping gracefully?'
> 
> 
> However all is not lost. You can access the sorted list by doing
> 
> <xsl:variable name="x">
>   <xsl:for-each....
>     <xsl:sort/>
>   ....
> </xsl:variable>
> 
> then use it as in
> 
> <xsl:apply-templates select="exslt:node-set($x)"/>
> 
> where exslt: is the prefix for your processors extension namespace.
> All the major XSLT systems (I think) offer a node-set() function for
> this use.
> 
Interesting - at first glance I thought that this broke the principle
that node-set expressions and variables don't have an independent order
property, that they use either the document order or an order dictated
by their XSLT or Xpath context.

Then I realised that because the new node-set was created by value
rather than by reference the nodes are actually in "RTF order", as when
the variable was created.

I suspect this won't be the last time that this property of node-set()
catches me out!

Francis.

 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.