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

RE: Q on <xsl:sort>

Subject: RE: Q on <xsl:sort>
From: "Walter Torres" <walter@xxxxxxxxx>
Date: Wed, 2 May 2001 18:31:53 -0500
RE:  Q on <xsl:sort>
OK, let start over here...

I get the same results with...

     data-type='number' and select='./interaction/timestamp/@unix'

     data-type='text' and select='./interaction/timestamp/'

I am not getting what I am thinking I am asking for.

I think I am asking for a sort on the NODE timestamp by text, or on the
attribute unix by number.

What I am getting is the data set sorted by 'record' order. Meaning the
order the data is in the original xml file is the way it is coming back.

If I add,  order='descending', the data is displayed...
   record 4
   record 3
   record 2
   record 1

If I do order='ascending', the data is displayed...
   record 1
   record 2
   record 3
   record 4

This is not what I think I am asking for.

It should display (based upon the time of each record)...
   record 4
   record 1
   record 3
   record 2

I undestand that if I use 'number' with a text data I will get NaN and I
will not gt what I want.

So, what am I missing here. What am I not seeing?

thanks for your help.

Walter


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay
> Sent: Wednesday, May 02, 2001 3:27 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: 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


 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.