From 33d59e121f9f919f3fcb81dcc3225caca164f99b Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 23 May 2013 16:11:20 +0100 Subject: Name and prefix were already compared. Add sane namespace comparison. Remove broken comparison stuff. Remove TODO from previous commit. --- src/core/node.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/node.c b/src/core/node.c index a920797..a09bf97 100644 --- a/src/core/node.c +++ b/src/core/node.c @@ -1589,6 +1589,7 @@ dom_exception _dom_node_lookup_namespace(dom_node_internal *node, * + The node entities are equal * + The node notations are equal * TODO: in document_type, we should override this virtual function + * TODO: actually handle DocumentType nodes differently */ dom_exception _dom_node_is_equal(dom_node_internal *node, dom_node_internal *other, bool *result) @@ -1609,7 +1610,7 @@ dom_exception _dom_node_is_equal(dom_node_internal *node, assert(node->owner != NULL); assert(other->owner != NULL); - /* Compare the node names */ + /* Compare the node names (and prefix) */ err = dom_node_get_node_name(node, &s1); if (err != DOM_NO_ERR) { /* error */ @@ -1627,14 +1628,13 @@ dom_exception _dom_node_is_equal(dom_node_internal *node, goto cleanup; } - /* TODO: surely this bit is broken */ - if (node->name != other->name || - node->namespace != other->namespace || - node->prefix != other->prefix) { + /* Compare namespace URI */ + if (dom_string_isequal(node->namespace, other->namespace) == false) { /* different */ goto cleanup; } + /* Compare node value */ if (dom_string_isequal(node->value, other->value) == false) { /* different */ goto cleanup; @@ -1653,7 +1653,7 @@ dom_exception _dom_node_is_equal(dom_node_internal *node, goto cleanup; } - if (dom_namednodemap_equal(m1, m2) != true) { + if (dom_namednodemap_equal(m1, m2) == false) { /* different */ goto cleanup; } @@ -1671,7 +1671,7 @@ dom_exception _dom_node_is_equal(dom_node_internal *node, goto cleanup; } - if (dom_nodelist_equal(l1, l2) != true) { + if (dom_nodelist_equal(l1, l2) == false) { /* different */ goto cleanup; } -- cgit v1.2.3