I am using an XSLT stylesheet to create an Excel document from an XML file. One of the values that I am pulling in I want to display as upper case. How is this possible?
XSLT 2.0 has fn:upper-case() and fn:lower-case() functions. However in case you are using of XSLT 1.0, you can use translate():
<xsl:template match="/">
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" />
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
<xsl:value-of select="translate(doc, $smallcase, $uppercase)" />
</xsl:template>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With