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

Sort question

Subject: Sort question
From: "Tom Whitehouse" <whitehousetom@xxxxxxxxxxx>
Date: Thu, 27 Feb 2003 15:15:38 +0000
tom whitehouse
Is it possible to sort a set of elements with an unknown number of sort keys:

<root>
	<crumbtrail>
		<crumb>top</crumb>
		<crumb>sport</crumb>
		<crumb>football</crumb>
		<crumb>liverpool</crumb>
	</crumbtrail>
	<crumbtrail>
		<crumb>top</crumb>
		<crumb>sport</crumb>
	</crumbtrail>
	<crumbtrail>
		<crumb>top</crumb>
		<crumb>sport</crumb>
		<crumb>cricket</crumb>
	</crumbtrail>
</root>


I need to sort this in the first instance depending on the first crumb element, then if two crumbtrails share identical values on the second crumb element etc.etc.


The problem is There could be any number of crumb elements and I don`t want to have to write

<xsl:sort select="crumb[1]"/>
<xsl:sort select="crumb[2]"/>
<xsl:sort select="crumb[3]"/>
<xsl:sort select="crumb[4]"/>
<xsl:sort select="crumb[5]"/>
.
.
etc.

as the sort key since there could be any number of crumb elements.

Thanks







_________________________________________________________________
MSN Messenger - fast, easy and FREE! http://messenger.msn.co.uk


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.