W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2003

[F&O] Deep Equality of Nodes

From: Dimitre Novatchev <dnovatchev@yahoo.com>
Date: Sat, 22 Nov 2003 06:47:42 -0800 (PST)
Message-ID: <20031122144742.85634.qmail@web41103.mail.yahoo.com>
To: public-qt-comments@w3.org

Two issues and a comment:

Issue 1:
The following text contradicts the code that it attempts to explain:

"Return true if the the two nodes have names that compare equal as
xs:QNames or if they do not have names.

if (not(fn:deep-equal(fn:node-name($parameter1),
then fn:false()

Obviuosly, the explanation must be something like:

     "Return false if the two nodes have different names."

Issue 2:
"Check if both element nodes have simple types. if so, compare their typed
values, else compare their children recursively. The result is true if and
only if the children of both nodes are all pairwise deep-equal, ignoring
comment and processing instruction node children in both cases."

What is the rationale for ignoring comment and PI children?

Such a decision results in the strange fact that two nodes with different
number of children may be deep-equal.

Using code to define the function is a good step forward, however the
presented code seems too lengthy and unstructured.

Probably the code would be shorter and more understandable if a few
auxiliarry functions were defined and used in it.

Dimitre Novatchev.

Do you Yahoo!?
Free Pop-Up Blocker - Get it now
Received on Saturday, 22 November 2003 09:48:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:15 UTC