RE: [xsl] Sorting chemical formulae in XSLT 2.0

Subject: RE: [xsl] Sorting chemical formulae in XSLT 2.0
From: "Emma Burrows" <Emma.Burrows@xxxxxxxxxxx>
Date: Thu, 25 Nov 2010 10:16:19 -0000
From: emmanuel.begue@xxxxxxxxx [mailto:emmanuel.begue@xxxxxxxxx] On Behalf Of
Emmanuel Bigui
>I think regexp would help. While it's been a while since I have had to
>deal with chemical elements, and am therefore not sure I completely
>understand your requirements, the following stylesheet gives the
>expected result:

Thanks, that's exactly the kind of solution I was after, and it sorts the
elements in the full list correctly (at least based on the sample list I've
been given).

The Saxon collation David suggested looks like a very useful tip, but in this
case, it sorted the numbers before the letters, so CH2O appeared after C2Cl4
which wasn't the desired outcome. I dare say it would have worked with some
tweaking, but the regex solution is perfect.

Cheers,
Emma

Current Thread