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

RE: Parameterized sort

Subject: RE: Parameterized sort
From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Tue, 1 Apr 2003 15:00:35 +0100
xsl parameterized sorting
Hi Kim,

[...]

>  I know that the sort key if 
> defined as 
> parameter, I should use "xalan:evalue($sortKey)" or "*[name() 
> = $sortKey]".  
> In this case, I want to sort the rows by the FirstName column 
> or by LastName 
> column and First Name.

You don't need the evalue function, or name() here.

> If I say,
> <xsl:sort select="column[@name='FirstName']"/>
> then, it works properly.

so just use
	<xsl:sort select="column[@name=$sortKey]"/> 
where $sortKey contains either "FirstName" or "LastName". 

You've given the columns @name attributes, so you don't need the name()
function.

On the other hand, if you had
<row>
	<columnA>foo</columnA>
	<columnB>bar</columnB>
</row>
and you wanted to sort either on columnA or columnB, you'd use
	<xsl:sort select="*[name()=$sortKey]"/>

HTH,
Tom SW

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • Parameterized sort
    • Kim Tran - Tue, 1 Apr 2003 08:21:54 -0500 (EST)
      • <Possible follow-ups>
      • Stuart Brown - Tue, 1 Apr 2003 08:49:48 -0500 (EST)
      • TSchutzerWeissmann - Tue, 1 Apr 2003 08:57:24 -0500 (EST) <=

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.