[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Question on Kaysian method for set intersection

Subject: Re: Question on Kaysian method for set intersection
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 28 Mar 2012 12:39:19 +0100
Re:  Question on Kaysian method for set intersection
On 28/03/2012 12:16, Hermann Stamm-Wilbrandt wrote:
I used Kaysian method as described in this document (section 1c), sofar:
http://www.xml.org//sites/www.xml.org/files/xslt_efficient_programming_techniques.pdf#page=3


Now I wanted to use it similarly for nodesets from different parts of document. That does not work because /flags[1]/flag[.='A'] is not the same node as /flags[2]/flag[.='A']. Is it possible to get the flag with "A" for $int and flags for "A", "B" and "C" for $uni? If so, with keys?

The so-called Kaysian method is a way of doing identity-based node-set intersection and difference in XSLT 1.0, which does not offer the "intersect" and "except" operators.

You seem to be wanting to do equality-based intersection and difference, which is actually much simpler, for example

$x/ns1/flags/flag[not(. = $x/ns2/flags/flag)]

selects the flags that are in ns1 but not in ns2.

Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.