This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: CASE-CONVERSION
- From: Morten Primdahl <morten at it-c dot dk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 05 Mar 2002 14:57:51 +0100
- Subject: Re: [xsl] CASE-CONVERSION
- References: <20020305131759.31456.qmail@mailweb20.rediffmail.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Kim Durand wrote:
> HI i have a problem of case conversion
>
> xml file looks like this
>
> <colors>
>
> <color>red</color>
> <color>blue</color>
> <color>orange</color>
> <color>black</color>
> <color>white</color>
>
> </colors>
>
> i need to apply transformation and produce the result
>
> Colors:
>
> RED BLUE ORANGE BLACK WHITE
>
> notice that the case is changed in the result.. it is uppercase. the xsl
> should convert to uppercase , no matter what it gets as input..
>
> i can try translate() function , but it requires to know what i want to
> translate and what i want to translate it to.In my case since i dont
> know what would be the text in the color ellement, I reckon translate()
> wouldnt be of much help .
>
> Can any one suggest me how i can go ahead with this??
Use translate :) It's not a string/string mapping, it's a
charlist/charlist mapping.
Ie. translate("my string","ms","MS") gives My String
So just enter the entire alphabet and it will do the trick.
Morten
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list