This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Capitalizing content of a variable
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Capitalizing content of a variable
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Thu, 9 Aug 2001 10:20:34 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Since at the time of transforming the contents of variable I
> don't know the
> exact contents hence I unable to figure out how to use
> translate function.
Sorry if I was assuming too much knowledge.
If the data is in a variable named foo, write
<xsl:value-of select="
concat(
translate(substring($foo,1,1), "abcdefg.... ", "ABCDEFG..."),
substring($foo, 2)
)"/>
It probably makes sense to put the lower-case and upper-case alphabets in
global variables.
Mike Kay
Software AG
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list