xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Sorting times in xslt


Subject: [xsl] Sorting times in xslt
From: Matthew Cordes <mcorde61@xxxxxxxxx>
Date: Tue, 2 Jan 2001 10:47:59 -0500

Hello all, 

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>

and I wish to sort it by the value attribute, thus generating the 
following:

<times>
	<time value="1:15"/>
	<time value="9:43"/>
	<time value="10:45"/>
	<time value="20:48"/>
	<time value="35:27"/>
</times>

The problem is that due to the colons the value is evaluated as a 
string, not a number and thus produces:

<times>
	<time value="1:15"/>
	<time value="10:45"/>
	<time value="9:43"/>
	<time value="20:48"/>
	<time value="35:27"/>
</times>

Note the 10:45 is out of place.  Any ideas?

-matt

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor