Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

Performing Set Operations on Node Sets Using Value Semantics

Problem

You
need to find the union, intersection, set difference, or symmetrical
set difference between elements in two node sets; however, in your
problem, equality is not defined as
node-set identity. In other words,
equality is a function of a
node’s value.

Solution

The need for this solution may arise when working with multiple
documents. Consider two documents with the same DTD but content that
may not contain duplicate element values. XSLT elements coming from
distinct documents are distinct even if they contain elements with
the same namespace, attribute, and text values. See Example 7-1 to Example 7-4.