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: Mon, 14 Dec 1998 15:55:49 -0500 (EST)
Message-ID: <13941.31549.873183.1048@weyr.cnri.reston.va.us>
To: John Cowan <cowan@locke.ccil.org>
Cc: www-dom@w3.org, xml-sig@python.org

John Cowan writes:
 > To be precise:  Fully general equality (fge) for mutable objects is
 > identity.  Fge for immutable objects is the fge-ness of their parts,
 > since indiscernable objects are identical (Leibniz's criterion).

  Leibniz?  Wow, and to think I actually know the name!  Shades of a
day long past!  (I first heard of Leibniz when I studied architecture, 
of all things!)
  I think this is just about where we've ended up on this one, but it
is definately stricter than is generally used for Python.  Typically,
two Python objects (let's take lists as an examples) are considered
equal if their contents are the same; equality of two objects is not
considered to be an unchangable characteristic.  If I have two lists:

	a = [1, 2]
	b = [1, 2]

they are considered equal now, but if I then do this:

	a.reverse()

they are no longer equal.  I think the biggest problem for doing this
with DOM nodes is the issue of context: if the parents are different,
the nodes should probably be considered different.
  Now, if I create two different nodes and insert equivalent data into 
each (say, character data nodes that contain equal data), I think they 
should compare equal.  The problem is that this is not the interesting 
case in practice.  What I *wanted* was less clearly a matter of
equality, and more a matter of a particularly strong correspondence.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives
1895 Preston White Dr.	    Reston, VA  20191
Received on Tuesday, 15 December 1998 03:58:47 GMT

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