This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Baffled by xsl:sort - want to process nodes in reverse document order.
- To: xsl-list at mulberrytech dot com
- Subject: Baffled by xsl:sort - want to process nodes in reverse document order.
- From: Dylan Walsh <Dylan dot Walsh at Kadius dot com>
- Date: Wed, 27 Sep 2000 16:04:18 +0100
- Reply-To: xsl-list at mulberrytech dot com
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