From 2127637945ea6b763966398130e0770fa993c860 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@gcc.gnu.org>
Date: Tue, 17 Jan 2006 18:09:40 +0000
Subject: Imported GNU Classpath 0.20

       Imported GNU Classpath 0.20
       * Makefile.am (AM_CPPFLAGS): Add classpath/include.
       * java/nio/charset/spi/CharsetProvider.java: New override file.
       * java/security/Security.java: Likewise.
       * sources.am: Regenerated.
       * Makefile.in: Likewise.

From-SVN: r109831
---
 libjava/classpath/gnu/xml/dom/DomElement.java | 33 +++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

(limited to 'libjava/classpath/gnu/xml/dom/DomElement.java')

diff --git a/libjava/classpath/gnu/xml/dom/DomElement.java b/libjava/classpath/gnu/xml/dom/DomElement.java
index 34509f6..f55b084 100644
--- a/libjava/classpath/gnu/xml/dom/DomElement.java
+++ b/libjava/classpath/gnu/xml/dom/DomElement.java
@@ -519,5 +519,38 @@ public class DomElement
     Attr attr = (Attr) attrs.getNamedItemNS(namespaceURI, localName);
     setIdAttributeNode(attr, isId);
   }
+
+  public boolean isEqualNode(Node arg)
+  {
+    if (!super.isEqualNode(arg))
+      return false;
+    getAttributes();
+    NamedNodeMap argAttrs = arg.getAttributes();
+    int len = argAttrs.getLength();
+    if (argAttrs == null || (len != attributes.length))
+      return false;
+    for (int i = 0; i < len; i++)
+      {
+        Node argCtx = argAttrs.item(i);
+        // Don't compare namespace nodes
+        if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI
+            .equals(argCtx.getNamespaceURI()))
+          continue;
+        // Find corresponding attribute node
+        DomNode ctx = attributes.first;
+        for (; ctx != null; ctx = ctx.next)
+          {
+            if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI
+                .equals(ctx.getNamespaceURI()))
+              continue;
+            if (!ctx.isEqualNode(argCtx))
+              continue;
+            break;
+          }
+        if (ctx == null)
+          return false; // not found
+      }
+    return true;
+  }
   
 }
-- 
cgit v1.1