Subject: Re: case and strings conversion
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Mon, 14 Feb 2005 09:47:14 -0800 (PST)
|
The following code would translate the word JaMeS into
all uppercase -
<xsl:template match="/xml">
<xsl:value-of select="translate(jim/@name,
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
</xsl:template>
While
<xsl:value-of select="translate(jim/@name,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
would translate into all lowercase.
Regards,
Mukul
--- dan sherman <h8_bsod@xxxxxxxxx> wrote:
> I am having trouble understanding strings and
> converting of cases. If I want to match something
> exaclty in the xsl the case must match exactly. I
> have
> read the prevois posts on changing the case to match
> but I am not getting it. How do I convert james to
> all
> lower or all caps to test in xsl. I have the code
> and
> below, but can not figure it out. Thanks.
>
> <xsl:value-of select="translate($string,
> 'abcdefghijklmnopqrstuvwxyz',
> 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
>
>
> <xml>
> <jim name=JaMeS">
> </xml>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com
|