Subject: RE: [xsl] Q on <xsl:sort> From: "Walter Torres" <walter@xxxxxxxxx> Date: Wed, 2 May 2001 18:31:53 -0500 |
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: [xsl] 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Q on <xsl:sort>, Michael Kay | Thread | RE: [xsl] Q on <xsl:sort>, Michael Kay |
RE: [xsl] Q on <xsl:sort>, Chris Bayes | Date | RE: [xsl] Q on <xsl:sort>, Dan Diebolt |
Month |