RE: Equality tests on DOM nodes

Wow.  I'm replying to myself.  If I did that walking down the street, people
would stare at me.

A further implementation difficulty has occurred to me:  There are likely
many people out there who would like to or are using the DOM in conjunction
with a database, making the node objects persistent.  These folks would
probably prefer that equality indicate not just that two nodes are identical
but that they represent the same record in the database.

Paul

-----Original Message-----
From: www-dom-request@w3.org [mailto:www-dom-request@w3.org]On Behalf Of
Paul Butkiewicz
Sent: Friday, December 11, 1998 1:20 PM
To: Ray Whitmer; Andrew M. Kuchling
Cc: www-dom@w3.org; xml-sig@python.org
Subject: RE: Equality tests on DOM nodes



>I don't know Python, but [e]very object in Java has an equals method to
>signify deeper comparison than "==", for example, String.equals tells
>whether the contents of two strings are identical.

I must be feeling contrary today, but I think you're saying isn't true.
String.equals( String ) does examine the contents of two different objects
to determine that they are identical.  But this is the case only because
String explicitly overrides the equals( Object ) method in Object, which
isn't true of many objects.  The equals( Object ) method in Object only
returns true if the objects are actually the same object, ie.
( *x )->equals( *y ) if and only if x == y.

Paul

Received on Friday, 11 December 1998 13:34:08 UTC