|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: upper case
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








