----- Original Message -----From: Michael KaySent: Thursday, March 11, 2004 5:12 PMSubject: RE: [saxon] Sorting on Strings
Wouldn’t a simpler solution be to translate(xxx, ‘ ‘, ‘_’) – i.e. replace spaces by underlines?
The “correct” solution in Java is probably to set up your own RuleBasedCollator, but I have to confess it’s a lot of work.
On the other hand, wouldn’t you get the right answer simply by invoking the Unicode code-point collation,
<xsl:sort select=”…” collation=”http://www.w3.org/2003/11/xpath-functions/collation/codepoint”/>
From: firstname.lastname@example.org [mailto:email@example.com] On Behalf Of Graeme St.Clair
Sent: 11 March 2004 21:29
Subject: [saxon] Sorting on Strings
I found a circumvention for my post of 7 Mar. Most of my 'catalog' values were things like 'G 4' or 'BWV1063'. And I thought the suggestion at http://www.dpawson.co.uk/xsl/sect2/N6461.html#d7476e270 might help, if I made sure that all catalog values contained a blank - then I could sort similarly to data-type="number" select="substring-after(.,' ')". Alas, catalog values for the too-prolific Telemann look like '53 F: 1', meaning the first concerto for 3 instruments in the key of F. I finally settled for:-
<xsl:sort data-type="text" ... select="translate(detail/@catalog,
Not especially elegant, but it seems to work.