Hello everyone,
I am trying to catch a special character with the following style sheet:
<xsl:param name="specChar" select="'\u201C'" />
<xsl:output indent="yes" method="xml"/>
<xsl:strip-space elements="*"/>
<xsl:template
match="CATALOOM-OPENENGINE/PRODUCTS/PRODUCT/PRODUCTREVISION">
<xsl:variable name="primKey2">
<xsl:value-of select="substring-before(@primarykey, '/')"/>
</xsl:variable>
<xsl:for-each select="FEATURE/VALUE">
<xsl:variable name="cdata">
<xsl:value-of select="FEATURE/VALUE/text()"/>
</xsl:variable>
<xsl:if test="contains($cdata, $specChar)">
<xsl:text>Found: </xsl:text>
<xsl:value-of select="$primKey2" />
<xsl:text> </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>
I am not getting any hits, though there should be a couple of thousands.
A few questions:
Is there anything overly wrong with this stylesheet?
The XML is like
<PRODUCTREVISION>
<FEATURE><VALUE>...</VALUE></FEATURE>
</PRODUCTREVISION>
How do I have to mask a unicode char inside a string inside a stylesheet?