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: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Wed, 2 May 2001 09:26:40 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> My problem is that this sort is not sorting on what I thought
> it would.
>
> <xsl:template match='callEvent/response/interaction_list'>
>
> <xsl:apply-templates>
> <xsl:sort select='./interaction/timestamp'
> order='descending'
> data-type='number' />
> </xsl:apply-templates>
>
> <interaction id='19766'>
> <timestamp
> unix='987413416000'>2001-04-16T04:30:32</timestamp>
By saying data-type="number", you are asking for the value to be converted
to a number, and the result of converting 2001-04-16T04:30:32 to a number is
NaN. So all records have the same sort key. A sort with the default data
type of "text" should work as you expect.
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list