XSL/T and performing Filtering
How do you filter out nodes which contain a value using a stop list? I have come across one example but I'm wondering is there any other way of doing it?
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sw="stopWords" exclude-result-prefixes="sw">
<sw:stop>
<word>AA_IT</word>
<word>AA_JA</word>
<word>AA_NN</word>
<word>AA_SP</word>
<word>AA_SW</word>
<word>AA_UK</word>
<word>AA_US</word>
</sw:stop>
<xsl:variable name="stop-words" select="document('')/xsl:stylesheet/sw:stop/word"/>
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="DM32IMPORT/SOFT_VINE_NEW[INDEX_CODE=$stop-words]">
<xsl:value-of select="DATE"/>
<xsl:value-of select="INDEX_CODE"/>
<xsl:value-of select="INDEX_VALUE"/>
</xsl:if>
</xsl:for-each>
<xsl:variable name="stop-words" select="document('')/xsl:stylesheet/sw:stop/word"/>
</xsl:template>
</xsl:stylesheet>