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

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

From: Fred L. Drake <fdrake@cnri.reston.va.us>
Date: Fri, 11 Dec 1998 13:06:45 -0500 (EST)
Message-ID: <13937.24366.729293.26105@weyr.cnri.reston.va.us>
To: "Paul Butkiewicz" <arabbit@earthlink.net>
Cc: <www-dom@w3.org>, <xml-sig@python.org>

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

  This is a very real concern.  I think comparison if nodes is only
interesting for equality.  When Python finally implements the "rich
comparison" semantics that have been proposed, equality will be
testable indepently of ordering.

 > to specify that two things are equal when they do not refer to the same
 > thing and/or measurable differences exist between them.  It seems obvious
 >  perhaps only to me ) that attributes must be equal and the equality must be
 > true recursively, if you dare to define equality for nodes.  I think the

  Well said.

 > Does context make a difference in equality or equivalence?
 > 
 > I could easily say that this paragraph is identical to that paragraph when
 > we're talking about a printed page, but XML, in it's most commonly discussed
 > usage, is about document metadata, and context is a part of that metadata.
 > A node is, after all, part of a larger document.

  A good point.  I was particularly interested in equality *without
consideration for parent*.  So, I was ignoring context.
  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.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives
1895 Preston White Dr.	    Reston, VA  20191
Received on Monday, 14 December 1998 08:38:55 GMT

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