This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Q on <xsl:sort>
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Q on <xsl:sort>
- From: Francis Norton <francis at redrice dot com>
- Date: Wed, 02 May 2001 09:20:00 +0100
- References: <001f01c0d27a$7aadfdc0$9750a8c0@ELOY01499>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Walter Torres wrote:
>
> It looks like it is displaying in reverse xml order not reverse timestamp
> order.
>
> any ideas?
>
Yes ... you're sorting with:
>
> <xsl:apply-templates>
> <xsl:sort select='./interaction/timestamp'
> order='descending'
> data-type='number' />
> </xsl:apply-templates>
>
but your data looks like this
> <timestamp unix='987413416000'>2001-04-16T04:30:32</timestamp>
you have a mismatch here - either do a numeric sort on
select='./interaction/timestamp/@unix'
since the unix attribute *is* numeric, or use your existing select with
data-type='text'
since timestamp's content is (given that XPath doesn't have any date /
time datatypes) alphanumeric.
Francis.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list