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

RE: Sorting on different elements...

Subject: RE: Sorting on different elements...
From: "Chris Ward" <cward@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Jan 2004 10:18:17 -0000
list of different elements
Many thanks.

Best regards
Chris

> -----Original Message-----
> From: Jarno.Elovirta@xxxxxxxxx [mailto:Jarno.Elovirta@xxxxxxxxx] 
> Sent: Thursday, January 22, 2004 10:15 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  Sorting on different elements...
> 
> 
> Hi,
> 
> > Sorry if this has been asked before - or is a daft question.
> 
> It's a FAQ.
>  
> > Is it possible to parameterise an <xsl:sort> ?
> > 
> > Example.
> > 
> > 	<root>
> > 		<data>
> > 			<firstname value="Fred"/>
> > 			<lastname value="Smith"/>
> > 		</data>
> > 		<data>
> > 			<firstname value="Tom"/>
> > 			<lastname value="Jones"/>
> > 		</data>
> > 		<data>
> > 			<firstname value="Myles"/>
> > 			<lastname value="Ward"/>
> > 		</data>
> > 		...
> > 	</root>
> > 
> > Sometimes I want to sort <data> on "firstname/@value" sometimes on 
> > "lastname/@value" based on a user parameter of some kind.
> 
> Use a sort rule
> 
>   <xsl:sort select="*[name() = $x]/@value"/>
> 
> where $x is bound to either "firstname" or "lastname".
> 
> Cheers,
> 
> Jarno - Covenant: Tension
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 

 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.