Subject: Re: [xsl] replace -x to -X From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx> Date: Mon, 10 Jul 2006 22:08:23 +0530 |
Can you please clarify whether the string is of form string1-string2. Or is it of form string1-string2- ......... -stringN ?
<xsl:variable name="small" select="'abcdefghijklmnopqrstuvwxyz'" /> <xsl:variable name="caps" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:template match="/"> <xsl:variable name="tmp_string" select="'JIMMY-DIMMy'" />
<xsl:variable name="string1" select="substring-before($tmp_string, '-')" /> <xsl:variable name="string2" select="substring-after($tmp_string, '-')" />
<xsl:variable name="result" select="concat(translate(substring($string1,1,1),$small,$caps),translate(substring($string1,2),$caps,$small),'-',translate(substring($string2,1,1),$small,$caps),translate(substring($string2,2),$caps,$small))" />
Regards, Mukul
I have a string $tmp_string.
for ex., JIMMY-DIMMy
And I need to change the following: first letter is in uppercase other letters are in lowercase first letters after "-" sign also is in uppercase
the result will be: Jimmy-Dimmy
I know how to make Jimmy-dimmy, but how to make Jimmy-Dimmy...???
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] replace -x to -X, Renate | Thread | Re: [xsl] replace -x to -X, Renate |
Re: [xsl] replace -x to -X, Renate | Date | Re: [xsl] replace -x to -X, Renate |
Month |