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

Re: multiple sorting

Subject: Re: multiple sorting
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 16 Aug 2000 23:46:36 +0100
setattribute select
Iyer,

I think that the problem is that with the line:

       sortField.setAttribute "select","'"+ field +"'"

you are setting the xsl:sort to look like:

  <xsl:sort select="'NAME'" />

When the select expression is evaluated for each of the nodes that's being
sorted, it always comes up with the same value, the string 'NAME'.  If you
instead want it to sort on the value of the *child node* called NAME, then
you want either:

  <xsl:sort select="*[name() = 'NAME']" />

(which is equivalent to changing the value of the parameter and leaving the
sort expression as it is) or simply:

  <xsl:sort select="NAME" />

To create the latter, you just need to take out the extra quotes that are
making the XSLT processor interpret it as a string rather than an element
name:

  sortField.setAttribute "select",field

I haven't tested this, but I think it might work.

I hope this helps,

Jeni

Jeni Tennison
http://www.jenitennison.com/


 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-2011 All Rights Reserved.