I'm having trouble with, what I believe, is an inability to filter a variable node-set.
I have a variable which is populated with a node-set from a collection of documents and I'd like to echo the input and add the variable nodes if those nodes don't already exist in the input.
<xsl:variable name="views" select="collection('file:/C:/temp/?select=*.xml;recurse=yes')"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:copy>
<xsl:apply-templates select="@* | *"/>
<!-- having trouble with the filter here never works -->
<xsl:for-each select="$views/someElement[not(@name=(//someInputElement/@name))]">
<!-- copy stuff in -->
</xsl:for-each>
</xsl:copy>
</xsl:template>
note that there will be many instances of someInputElement with name attributes in the input.
when I run the xpath //someInputElement/@name against the target I get a listing as expected.
any advice most appreciated.
I believe I've found the answer... from a hint I found somewhere else today I've added a reference back to the root and used that in the filter.