RE: [xsl] Capitalizing content of a variable

Subject: RE: [xsl] Capitalizing content of a variable
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Thu, 09 Aug 2001 13:59:54 +0200
Tony Graham <Tony.Graham@xxxxxxxxxxxxxxx> wrote:
> Joerg Pietschmann wrote at  9 Aug 2001 10:29:54 +0200:
>  > You may also include non-ASCII characters in the translation string, if
>  > necessary. The following can be used to upcase german umlauts:
>  >   <xsl:variable name="lower" select="'&#xE4;&#xF6;&#xFC;'"/>
>  >   <xsl:variable name="upper" select="'&#xC4;&#xD6;&#xDC;'"/>
> 
> Yes, but that's not going to work for &#xDF;, LATIN SMALL LETTER SHARP 
> S, which has an uppercase mapping to 'SS', is it?
> 
> The other classic case is 'i', which has an uppercase mapping to
> &#x130; in Turkish and Azeri only.
> 
We should be grateful that there are simple solutions at least for
*some* parts of the problem space. :-)

But as you brought up the point: AFAIK both "MASSE" and "MASZE" are
valid uppercase versions for "Ma&#xDF;e", because the former is
ambiguous, legal texts prefer the latter. So upcasing (<-- is this
already a legal word?) strings may depend on a wider context.
Fortunately, because &szlig; (=&#xDF;) must not be the first character
of a word, this is irrelevant for capitalisations. Furthermore,
translate() is not strictly intended to handle localised string
manipulations, the standard developers may claim abuse :-)

I have to say that it is surprisingly hard to get comprehensive,
precisely worded standards for localised, language dependend string
processing. The Unicode Standard goes a long way to provide definitions
of categories to think in, but such stuff as what is applicable
for a certain language such as character set, concepts of character
case, case transformations, collation rules and the like appears to
be spread across a lot of paper. My edition of the "Duden" has
rather ambiguous formulations, and it does not even mention the
DIN-Standards regulating these details for the german language. Apart
from this, swiss regulations differ in minor but important details,
most notably there is no &szlig; in swiss german, which makes your
first problem irrelevant to me.
If you have some good sources, I'd be quite interested in hearing about
them.

Regards
J.Pietschmann

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread