How to form the intersetion between 2 node sets

Your help will be most appreciated.

I’m trying to form the intersection of 2 node sets (will select nodes that exist in both node sets).

Following the Kay book on the UnionExpr, I am not able to get the same results. Why is this not giving me an intersection:

xml: <_mapBody>
<_mapRdfDescription>
2
1
</_mapRdfDescription>
<_mapRdfDescription>
1
3
4
</_mapRdfDescription>
</_mapBody>


xslt:

<xsl:stylesheet xmlns:xsl=“XSLT Namespace
xmlns:ino=“http://namespaces.softwareag.com/tamino/response2
xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)
version=“1.1”>

<xsl:variable name=“srch1” select=“/_mapBody/_mapRdfDescription[1]/test”/>
<xsl:variable name=“srch2” select=“/_mapBody/_mapRdfDescription[2]/test”/>

<xsl:template match=“/”>
<xsl:apply-templates select=“$srch1[count(. | $srch2)=count($srch2)]”/>
</xsl:template>

<xsl:template match=“node()[not (_mapBody)]”>
<xsl:element name=“_mapInoid”>
<xsl:value-of select=“.”/>
</xsl:element>
</xsl:template>

Here is the answer: The intersection of 2 nodes are those nodes that are actually the same, not a copy of the same values. So in my test data, the intersection would always be empty.

Here is the code that prints those nodes that share the same values in three different node sets:
search-apply-boolean.xsl (892 Bytes)