We’ll add a couple variables and a template to the strings.xsl stylesheet.
<!-- translation for lowercase-->
<xsl:variable name="lcletters" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="ucletters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:template name="str-tolower">
<xsl:param name="str"/>
<xsl:value-of select="translate($str, $ucletters, $lcletters)"/>
</xsl:template>
And here’s a new UT to add to strings.test.xsl:
<xsl:call-template name="assert">
<xsl:with-param name="expected" select="'@apple1'"/>
<xsl:with-param name="actual">
<xsl:call-template name="str-tolower">
<xsl:with-param name="str" select="'@ApPlE1'"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
Like this:
Like Loading...
Related