This may have already be answered somewhere, but I do not have right words to search it :
Lets say I have data file which has list of cities :
<cities>
<city abbr='A'>NameA</city>
<city abbr='b'>NameB</city>
</cities>
The cities list is long and I want to filter the cities based on abbr
[filter data]
<skip>
<abbr>A</abbr>
<abbr>B</abbr>
</skip>
How could I use the this filter data(in xml form) to skip some nodes from original data file , specifically how I can use in for-each loop e.g
<xsl:template match="/">
<xsl:for-each select="not in skip list">
???
</xsl:for-each>
</xsl:template>
I want to use the filter data internally within the XSLT file in the form of xml format as the list might get too long.What are the options to include the file within the xslt? Currently I am using SAXON sth like this.
java -jar /usr/local/liquibase/saxon/saxon9he.jar ./base/cities.xml ./templates/split_cities.xslt authorName=sakhunzai
This example is over simplification of original data
You tagged your question with saxon tag so I assume you are using xslt 2.0.
You could make a variable holding values to be skipped
Then you could test attribute of nodes against this variable
So for input
Following xslt
Produces output
EDIT:
It makes sense to store filter in external file. Let skip.xml be such file with structure
Then you can change variable declaration in following manner
Other thing might stay unchanged.