W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: [XML-SIG] RE: Equality tests on DOM nodes

From: Gabe Wachob <gwachob@aimnet.com>
Date: Fri, 11 Dec 1998 13:48:24 -0500 (EST)
To: "Fred L. Drake, Jr." <fdrake@acm.org>
cc: Paul Butkiewicz <arabbit@earthlink.net>, www-dom@w3.org, xml-sig@python.org
Message-ID: <Pine.GSO.4.05.9812111039350.19876-100000@shell1.ncal.verio.com>
On Fri, 11 Dec 1998, Fred L. Drake wrote:

> 
> Paul Butkiewicz writes:
>  > Not to sound facetious, but to put this question in context, I might well
>  > ask how we implement < and > for nodes?  We generally don't use those
>   Perhaps there is no fully general equality that isn't identity?  I
> think the Python implementation would still require implementation of
> a comparison method to achieve this since it uses proxy nodes, but
> that's really just an implementation detail.  Python's native identity 
> operator doesn't work in the presence of proxies that represent the
> same node.

Before you define equality generally for nodes, don't you have to define
equality for each element and even each attribute? This may be a trivial
task, but I suspect there are some issues (like if a Text node contains an
entity reference, which, after being evaluated, results in a text string
which is the same text string contained in another Text node without that
entity referene) that are not specified. 

Another issue would be order of children. Without a DTD, how do you tell
when order of child elements is significant? Perhaps this has to be an
parameter to the deep comparison operator. 

If you made a decision on these issues and defined a comparison operator,
I would say that it should be recursive because otherwise, the comparison
operator isn't all that useful. Of course, given all the vagaries in the
mapping of semantics of the word "equal" to the semantic meanings of
various subtrees of two DOM trees, I wonder whether a single generalized
equality operator will be useful to many people..

	-Gabe

-------------------------------------------------------------------
http://www.aimnet.com/~gwachob               http://www.findlaw.com
"A popular Government, without popular information, or the means of 
acquiring it, is but a Prologue to a Farce or a Tragedy; or perhaps 
both." -- James Madison 
                       import std.disclaimer
Received on Monday, 14 December 1998 08:39:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:46 GMT