I'm trying to sort a list by the name of each element. Example:
Title One
Another Title
Å Another Title
Ø Yet Another Title
The output of this using the original sort-function will result in something like this:
Another Title
Title One
Å Another Title
Ø Yet Another Title
While the desired output is:
Another Title
Title One
Ø Yet Another Title
Å Another Title
For those not familiar with the special characters 'Æ', 'Ø' and 'Å', these are three letters that is the Norwegian extension of the alphabet. So the Norwegian alphabet ends like this "...STUVWXYZÆØÅ". And due to this extension, using a regular xsl:sort will for example put 'Å' before 'Ø'. It seems to me that xsl sorts elements based on their ASCII values, and for some reason the ASCII values are not ordered correctly (i.e., not in the same order as the alphabet) for 'Æ', 'Ø' and 'Å'.
I've found a somewhat solution to this, however it requires more code than I like and I have to use it in several places (in the same xsl-document), making it even more cumbersome with the extensive code. Here's the approach I'm using right now:
<xsl:sort select="translate(current-grouping-key(), 'abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ0123456789', '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZæÆøØåÅ')" data-type="text" order="ascending" case-order="lower-first"/>
As you see, this is quite a handful. Is it either a simpler way to use this in several places (like specifying a mode or something), or another approach that is not this extensive.