This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Sorting times in xslt


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]