This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Sorting times in xslt
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Sorting times in xslt
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Tue, 2 Jan 2001 18:38:12 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I'm curious what possible solutions you folks might have for sorting
> times in XSLT.
>
> e.g.
>
> I have the following xml:
>
> <times>
> <time value="10:45"/>
> <time value="1:15"/>
> <time value="9:43"/>
> <time value="35:27"/>
> <time value="20:48"/>
> </times>
>
Break up the time using substring-before() and substring-after(), and use
the two parts as major and minor sort key, both with data-type="number".
Alternatively, use translate() to turn the ":" into a "." and then treat it
as a single numeric sort key.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list