[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Sorting chemical formulae in XSLT 2.0

Subject: RE: Sorting chemical formulae in XSLT 2.0
From: "Emma Burrows" <Emma.Burrows@xxxxxxxxxxx>
Date: Thu, 25 Nov 2010 10:16:19 -0000
RE:  Sorting chemical formulae in XSLT 2.0
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.