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

RE: [ nodeset equivalence in intersection extension function

Subject: RE: [ nodeset equivalence in intersection extension functions/elements ]
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 30 Nov 2000 09:54:22 -0000
michael kay xpath union nodeset
> Mike Kay's book states: "2 node-sets are equal (returns true in an
> expression) if there is a pair of nodes, one from each 
> node-set, that have the same string value"
> 
> This definition to me is confusing since sometimes we want 
> only the nodes
> with same "nodeName", attribute lists and string-value to be 
> considered equal.

I don't think you find the definition confusing, you just wish it was
different!

> In other words, I want strict equivalence. Sample below illustrates -

"strict" implies a value judgement. You just want a boolean function that
compares two nodes and has different semantics from the XPath "=" operator.
Which is fair enough.

> Contrast this to the intersection() extension element from 
> xt. In this case,
> even the hierachy of childnodes below an element must be 
> equivalent (in
> addition to equivalent nodenames, attribute values etc...)

I suspect you will find that the intersection function in xt works like the
union operator, it compares nodes for identity, not for any kind of
"equivalence". Two nodes A and B are identical if count(A|B)=1. 

You can do a set intersection, as defined here, in standard XPath by writing

$A[count(.|$B) = count($B)]

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.