[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: sorting strings question
I found my mistake... i was sorting on a complex node instead of a = textnode which was 1 level deeper (childnode). So default sorting does the trick like you all pointed out. Thx for the tip. Robby -----Original Message----- From: Michael Kay [mailto:mike@xxxxxxxxxxxx] Sent: Thursday, March 18, 2010 1:32 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: sorting strings question > > I have a concrete example: > > When I have following strings ['BSS84/A2', 'BSS84/DG', 'BSS84'], > > default sorting results in: > > BSS84/A2 -> BSS84/DG -> BSS84 > That's a very strange result; all the usual collations sort A before B if A is a leading substring of B. But it's not against the XSLT rules, as far as I can tell. The key point is that collating is product-dependent, so there's not much point asking the question without defining what product you are using. In XSLT 2.0 the only "standard" collation is the Unicode codepoint collation, and that's consistent with the order you are wanting. Also, giving three data points and saying how they should appear isn't enough data to allow the general rules to be inferred. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|