Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2014, 08:28 PM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 119
Thanks: 25
Thanked 3 Times in 3 Posts
Default Sort words based on custom order

Hi Everyone!

Using XSLT 1.0 I need to sort a list of words based on a string variable.

<xsl:variable name="upper">ABCDEFGHIJKLMNÑOPQRSTUVWXYZ</xsl:variable>

Notice the funny "Ñ" half way through the string? The sorted order of the words needs to follow the string from left to right in that order.

Is this even possible to do without using collations?

Or am I going about it the wrong way using a string variable?

Any help would be greatly appreciated.

Regards, John.
The Following User Says Thank You to JohnBampton For This Useful Post:
 
Old March 2nd, 2014, 05:36 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Have you tried setting lang="es" on the xsl:sort element?
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old March 2nd, 2014, 09:12 AM
Friend of Wrox
 
Join Date: Feb 2009
Posts: 119
Thanks: 25
Thanked 3 Times in 3 Posts
Default

Thanks for responding Mr Kay!

Indeed I was using lang="es".

I figured out what the issue was. I was using xsltproc from the commandline, xsltproc that came bundled with my new iMac. It seems like its a old version of xsltproc and it was not producing the correct results. I also use oXygen XML editor and this produced a different result than xsltproc on the command line as oXygen had newer versions of the XSLT processors installed.

Which lead me to download a copy of Saxon 9 home edition jar file which when run produced the correct result.

I have now advised my client to use Saxon.

Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic sort order or sort datatype kapy_kal XSLT 2 September 18th, 2007 02:10 PM
sort mispelt words crmpicco Javascript 4 March 2nd, 2006 10:19 AM
how to sort cross tab.sort based on row total joxa83 Crystal Reports 7 March 2nd, 2006 09:12 AM
sort recordset in different order pablohoney Classic ASP Databases 0 December 29th, 2005 08:32 PM
Sort order Question Tere Crystal Reports 1 February 14th, 2005 03:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.