I am trying to use contains() where i want to display the node value only when it does not contain number but I get all the node values in result. Below is my code and sample XML. My code is as below: Please let me know where I am doing wrong.
my code:
<xsl:variable name="restricted_characters" select="1234567890"/>
<xsl:for-each select="test/a">
<xsl:if test="not(contains(. , $restricted_characters))">
<xsl:value-of select="position()" />:
<xsl:value-of select="." />
</xsl:if>
</xsl:for-each>
XML:
<test>
<a>abc11</a>
<a>123</a>
<a>abc</a>
<a>abc2</a>
<a>abc3</a>
<a>abc</a>
</test>