This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Q on <xsl:sort>


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]