SAXEventSink.java: Ignore element declarations if not currently parsing the DTD.
authorChris Burdess <dog@bluezoo.org>
Thu, 10 Mar 2005 19:44:22 +0000 (19:44 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 10 Mar 2005 19:44:22 +0000 (19:44 +0000)
2005-03-10  Chris Burdess  <dog@bluezoo.org>

* gnu/xml/dom/ls/SAXEventSink.java: Ignore element declarations if
not currently parsing the DTD.

From-SVN: r96255

libjava/ChangeLog
libjava/gnu/xml/dom/ls/SAXEventSink.java

index b92bf687e695029ca0cff7685086ff0843f236de..4a68654f2635558186e60f5f3f12bd2e8a650b67 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-10  Chris Burdess  <dog@bluezoo.org>
+
+       * gnu/xml/dom/ls/SAXEventSink.java: Ignore element declarations if
+       not currently parsing the DTD.
+
 2005-03-10  Bryce McKinlay  <mckinlay@redhat.com>
 
        New Stack Trace infrastructure.
index 24f6cccf5b852a735fdcc06772efa4e61c61994e..60b99d49305474a999ec365dc2c7b1c10408c9a1 100644 (file)
@@ -486,6 +486,13 @@ class SAXEventSink
       {
         return;
       }
+    // Ignore fake element declarations generated by ValidationConsumer.
+    // If an element is not really declared in the DTD it will not be
+    // declared in the document model.
+    if (!(ctx instanceof DomDoctype))
+      {
+        return;
+      }
     DomDoctype doctype = (DomDoctype) ctx;
     doctype.elementDecl(name, model);
   }