intersect and except implementation

T

tmuldner

Does anybody know any implementation of XPaths that supports path
intersection and difference?
 
J

Joe Kesselman

Websearch comes up with the "Kaysan method" for expressing these, by
leveraging the union operator and count to check for an element's
presence in the other set:

Intersection:
$set1[count(.|$set2)=count($set2)]

Symmetric difference:
( $set1[count(.|$set2)!=count($set2)]
| $set2[count(.|$set1)!=count($set1)] )
 
D

Dimitre Novatchev

As others have pointed out, the Kaysian method (originally used with XPath
1.0) has been around the last seven years.

Also, "intersect" and "except" are operators in the standard XPath 2.0
language, for which several implementations exist.

Embedded in XSLT 2.0: Saxon, Gestalt, Altova

Embedded in XQuery 1.0 -- many.


Cheers,
Dimitre Novatchev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top