In a previous post I saw that you can use translate twice. I have been trying to follow the example that I saw but have not been able to get it to work.
I would like to see if this can remove unknown characters, for instance if we wanted to display only numbers but do not know what characters will be in the XML node.
Here is my code:
<xsl:variable name="myString">ABCDEFGHIJKLMNOPQRSTUVWXYZ-@!#$%^&*-=+0123456789</xsl:variable>
<xsl:template match="/">
<p>Here is the original string: <xsl:value-of select="$myString" /></p>
<p>Here is the string after we apply the Translate function 2 times:
<xsl:value-of select="translate(translate($myString, '0123456789', ''), '')" /></p>
</xsl:template>
This currently produces an error.
You’re only passing two arguments to the outer
translate, it needs three