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

How to sort a nodeset returned by key()?

Subject: How to sort a nodeset returned by key()?
From: Dolmen ! <dolmen@xxxxxxxxxxx>
Date: Sat, 5 Apr 2008 14:17:56 +0200
 How to sort a nodeset returned by key()?
Hi,

Short:
How can i sort a nodeset returned by key(), store it in a variable,
and still be able to compare its nodes with  nodes of the original
document ?

Long:

This is a transformation of my data set to an HTML table using rowspans.
I'm sorting my data, then I'm using a Muenchian grouping to group rows.

My problem is that the order of my sorted node set is not the same as
the order of the nodeset returned by key(). I have not found how to
reliably distinguish the first node of the group to output the
grouping cells in the right place.

I'm using xsltproc (from libxslt)

Here is an example using Steve Muench's data from
http://www.dpawson.co.uk/xsl/sect2/N7450.html#d11343e31

If I remove this sort, the XHTML, is clean, but the table is not sorted.





   Johnosn's Laundry
  Franks's Laundry
   Mary's Laundry
  Bill's Laundry
   Hammond's Laundry


  Franks's Diner
   Johnosn's Diner
  Hammond's Diner
   Mary's Diner
  Bill's Diner














   Accounts ordered by region


        RegionAccount



















Here is the broken HTML output :








  Accounts ordered by region




      Region
      Account


      Bill's Diner


      Mary's Diner


      Alaska
      Mary's Laundry


      Franks's Diner


      Canada
      Franks's Laundry


      Hammond's Diner


      Hammond's Laundry


      Johnosn's Diner


      Midwest
      Johnosn's Laundry


      New Jersey
      Bill's Laundry








Olivier Mengui.
http://o.mengue.free.fr/
_________________________________________________________________
Dicouvrez les profils Messenger de vos amis !
http://home.services.spaces.live.com/

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.