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

Re: Troubleshooting a sort

Subject: Re: Troubleshooting a sort
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 20 Feb 2004 00:53:14 GMT
wgo spot
<xsl:for-each select="//SAVEIdeas/SAVEIdea">
<xsl:sort select="*[name()=$param1]"/>

Usually, I'm sorting on a child of the root element (SAVE_ID,
date_submitted, etc.) These sorts are all working fine. But I also need
to sort on the *last* status element. Status is not a child of the root,
but a child of status_history. Is that the problem? Do I need to have
something conditional for the sort statement? I welcome any additional
suggestions! 

It's not a problem, but you have to make your sort xpath select teh
required element and * won't select a grandchild ever in xpath.


<xsl:for-each select="/SAVEIdeas/SAVEIdea">
<xsl:sort select="(*|*/*)[name()=$param1][last()]"/>

(I didn't spot the requiremnt you had for last() in previous reply)

-- 
http://www.dcarlisle.demon.co.uk/matthew

 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.