Adam:
if you don't care about supporting a lot of charsets, you could probably
just use the XPath function translate(), see section 4.2 of the XPath
spec. Like in the following fragment:
...
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
<!-- outputs the parameter converted to uppercase: -->
<xsl:template name="toupper">
<xsl:param name="what"/>
<xsl:value-of select="translate($what, $lower, $upper)"/>
</xsl:template>
...
Of course, using a special extension function might be more elegant but
none is currently available in Sablotron.
Tom
Adam Doppelt wrote:
>
> Hi. As part of running an XSL transform I would like to perform some case
> conversions on my XML data. There doesn't appear to be an easy way to do
> this with XSL, probably because of the internationalization issues. I was
> hoping for something like:
>
> <xsl:text case="uppercase" >sablot</xsl:text> ("SABLOT")
> <xsl:text case="capitalize">sablot</xsl:text> ("Sablot")
>
> etc.
>
> What is the best way to plug this functionality into XSL and Sablotron? The
> xsl:text example above was just a guess at one possible implementation.
>
> Thanks,
>
> Adam