Subject: RE: [xsl] xsl:sort and datatypes From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx> Date: Wed, 8 May 2002 14:58:29 +0100 |
> Dear Micheal, > > Dates are in 'dd-mm-yyyy' format then to sort them you do something like <xsl:sort select="concat(substring(.,7,4), substring(.,4,2), substring(.,1,2))"/> Michael Kay > > Ernst Wolthaus > > -----Original Message----- > From: Michael Kay [mailto:michael.h.kay@xxxxxxxxxxxx] > Sent: woensdag 8 mei 2002 10:05 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: RE: [xsl] xsl:sort and datatypes > > > Use data-type="number" on xsl:sort. > > For sorting on dates, tell us what format your dates are in. > > Michael Kay > Software AG > home: Michael.H.Kay@xxxxxxxxxxxx > work: Michael.Kay@xxxxxxxxxxxxxx > > > -----Original Message----- > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Ernst > > Wolthaus > > Sent: 08 May 2002 07:37 > > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > > Subject: [xsl] xsl:sort and datatypes > > > > > > Hi all, > > > > I was wondering if anyone could tell me if xsl:sort would > > sort the following > > xml correctly: > > > > <?xml version="1.0"?> > > <root> > > <data> > > <intNumber dt:dt="i4" > > xmlns:dt="urn:schemas-microsoft-com:datatypes">1</intNumber> > > </data> > > <data> > > <intNumber dt:dt="i4" > > xmlns:dt="urn:schemas-microsoft-com:datatypes">10</intNumber> > > </data> > > <data> > > <intNumber dt:dt="i4" > > xmlns:dt="urn:schemas-microsoft-com:datatypes">11</intNumber> > > </data> > > <data> > > <intNumber dt:dt="i4" > > xmlns:dt="urn:schemas-microsoft-com:datatypes">2</intNumber> > > </data> > > <data> > > </root> > > > > Because I get the next result: > > > > 1 > > 10 > > 11 > > 2 > > > > Of course I want: > > > > 1 > > 2 > > 10 > > 11 > > > > The data-type attribute of xsl:sort only support > > text/number/qname and I > > also want to sort on datefields. > > > > Thanks all! > > Ernst Wolthaus > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list 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] xsl:sort and datatypes, Ernst Wolthaus | Thread | [xsl] Re: Re: limiting preceding ax, Dimitre Novatchev |
RE: [xsl] Generic Lookup (Element M, Faroukh Fekravar | Date | [xsl] using identity transform to c, Zack Brown |
Month |