Madeyedexter
Madeyedexter

Reputation: 1193

XSLT Subtraction Operator

Just Like | operator, can we use the - operator on a node-set?

I have a two set of nodes - Set1 and Set2. I want to get another set which has all the elements in Set1 which are not in Set2.

Then I want to iterate over that set like this:

<xsl:for-each select="$Set1 - $Set2">
    <!--Process Child Nodes-->
</xsl:for-each>

Upvotes: 1

Views: 621

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167696

With XPath 1.0 you can use $set1[count(.|$set2) != count($set2)].

Upvotes: 1

Related Questions