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

Sort on multiple elements

Subject: Sort on multiple elements
From: Jitu <jibhatia@xxxxxxxxxxx>
Date: Fri, 23 Aug 2002 18:45:56 +0530
xsl sort multiple elements
Hi

i can use multiple xsl:sort statements, to sort on many elements.
But my problem is i do not know in advance, how many levels of sorting is required.


For example :
<employees>
   <employee>
       <firstname>John<firstname>
       <lastname>Vinegar</lastname>
       <age>25</age>
       <salary>25000</salary>
   </employee>
   <employee>
       <firstname>Jim<firstname>
       <lastname>Vander</lastname>
       <age>27</age>
       <salary>15000</salary>
   </employee>
   <employee>
       <firstname>Joshua<firstname>
       <lastname>Raspberry</lastname>
       <age>35</age>
       <salary>24000</salary>
   </employee>
   <employee>
       <firstname>Norman<firstname>
       <lastname>Wolf</lastname>
       <age>45</age>
       <salary>75000</salary>
   </employee>
</employees>

I may want to sort
by lastname
OR
by lastname,firstname (sort first by lastname and within it sort by firstname)
OR
by salary, age, lastname (sort by salary and within it sort by age and within that sort by lastname)


This fact i do not know in advance therefore i cannot hardcode it into my xsl. In other words i cannot write a fixed number of xsl:sort statements.

Your valuable inputs pls....



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.