[xsl] translation() function?

Subject: [xsl] translation() function?
From: Alice Ju-Hsuan Wei <ajwei@xxxxxxxxxxx>
Date: Sun, 11 Nov 2007 00:58:46 -0500

I wanted to generate a whole chunk of text from a mixture of upper and lower case letters to all upper case. The problem is that my original text has also child elements. Here is an example:


<p><emph rend="bold">Upper and lower case transformations</emph> are very easy in XSLT thanks to the translate function. An alternative solution could be to implement the transformation and switch character by character, but since <emph rend="bold">XSLT</emph> already gives us a <emph rend="red bold">better</emph> solution, let's better take advantage of it. </p>


<xsl:template match="p">
 <xsl:value-of select="upper-case(.)"/>

 <xsl:template match="emph">
           <xsl:call-template name="rend"/>

This code does output the upper case letters, but leaves out all other templates that associate with the additional formatting. I tried using <xsl:apply-templates/> inside the template, but then the text are no longer in upper case.

Any ideas, anyone?

Thanks in advance.


Current Thread