|
Subject: Re: [xsl] upper case From: Goetz Bock <bock@xxxxxxxxxxx> Date: Tue, 21 Aug 2001 15:32:02 +0200 |
On Tue, Aug 21 '01 at 15:01, john wa wrote:
> <xsl:value-of
> select="translate($string,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRST
> UVWXYZ')"/>
>
> is this the only way to make a string upper case?
Yes, its the only way.
You might want to define a global variable for the uppercase and one for
the lowercase letters:
<xsl:variable name="uppercase">ABCDEFGHIJ...</xsl:variable>
<xsl:variable name="lowercase">abcdefghij...</xsl:variable>
than you can use
<xsl:value-of select="translsate($string, $lowercase, $uppercase)" />
when you maintain a one-to-one mapping between upper and lowercase you
can add as much additional characters as you like (e.g. ä and
Ä)
> is it not very inefficient?
It depends, you should minimise the list of characters in the
upper/lowercase variable as good as you can. The runtime should be
O(length($string)*length($uppercase))
and I don't know how to make it any faster
> my xml needs to support other languages, do i need to worry about letters
> with accents? do they have uppercase versions too?
Ask someone who knows the language, e.g. there is no uppercase version
of ß in German.
BTW: my keyboard does not support the funky german characters, and I've
therefor used html entites I hope you can read them ;-)
--
Goetz Bock IT Consultant
Dipl.-Inf. Univ.
Attachment:
pgp00018.pgp
Description: PGP signature
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] upper case, john wa | Thread | [xsl] [OT] attachments?, Christian Cäsar |
| [xsl] Constructing X number of elem, Ilkka Hartikainen | Date | RE: [xsl] Constructing X number of , Jarno . Elovirta |
| Month |