This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: sorting results by date
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] sorting results by date
- From: "Ben Robb" <b dot robb at cscape dot com>
- Date: Mon, 24 Sep 2001 17:54:38 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Yes - for example:
<xsl:for-each select="datefield">
<xsl:sort select="substring(., 7, 4)"/>
<xsl:sort select="substring(., 4, 2)"/>
<xsl:sort select="substring(., 1, 2)"/>
<xsl:value-of select="."/>
</xsl:for-each>
> -----Original Message-----
> From: John Day [mailto:John.Day@hypnosismedia.com]
> Sent: 24 September 2001 17:16
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] sorting results by date
>
>
> Is it possible to sort by an element with the following format:
>
> 22-05-2001
>
> This is of course a date and is one of three sets of data that I am
> trying to write to the browser. I want to sort this data by
> the date in
> ascending order. I tried using the string() function and putting the
> result into a variable, then trying to sort via the variable, but I'm
> having no luck. The key is to separate the numbers and the hyphens,
> thereby sorting on the numbers alone.
>
> Regards
> John
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list