Case insensitive sorting

375 views
Skip to first unread message

aardv...@gmail.com

unread,
Jun 4, 2010, 12:06:47 AM6/4/10
to XSLT
Hi,

I use sort quit a bit, but the results are weird because xslt places
the uppercase results first. Thus, I get this:

Abba
Ecma
aSomething
aalways
bSomething
bnever

I've found a few complex solutions on the web, but I'm thinking there
must be a simple way to sort in case insensitive manner.

Ideas?

Thanks,

Ben

Christian

unread,
Jun 15, 2010, 9:36:17 AM6/15/10
to XSLT
Hi Ben

I just tested in Firefox and Saxon and it works as expected with
'Abba' and 'aSomething' as the first two. When using Saxon (XSLT 2.0)
I can use the function lower-case() on the "sorting string", like:
<xsl:sort select="lower-case(@title)" />

Maybe this could work for you?

Christian

On 4 Jun., 06:06, "aardvark...@gmail.com" <aardvark...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages