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

Baffled by xsl:sort - want to process nodes in reverse docum

Subject: Baffled by xsl:sort - want to process nodes in reverse document order.
From: Dylan Walsh <Dylan.Walsh@xxxxxxxxxx>
Date: Wed, 27 Sep 2000 16:04:18 +0100
xsl sort reverse
Hi. I am trying to process a set of elements, starting with the last, and
working towards the first. I have tried the following:

           <xsl:apply-templates select="someElementType">
              <xsl:sort select="position()" data-type="number"
order="descending"/>
            </xsl:apply-templates>

The xsl:sort is taken straight out of Michael Kays book. However when I run
it, the elements are processed in document order. If I change "descending"
to "ascending", the output is exactly the same.

If, on the other hand, I change the select to say, the value of an
attribute, instead of position(), it sorts them in reverse alphabetical
order according to the text in that attribute. If I change "descending" to
"ascending", the output is reversed. In other words, it works for strings
but not for position().

Can anyone explain to me what is going on? 


 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.