This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Capitalizing content of a variable


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]