Patch: FYI: SAX fix

Tom Tromey tromey@redhat.com
Thu Mar 10 23:21:00 GMT 2005


I'm checking this in on the 4.0 branch and the trunk.

This fixes a bug in SAXEventSink that affects Tomcat.  I'm just
merging this in -- Gary Benson noticed the bug and Chris Burdess fixed
it.

Tom

Index: ChangeLog
from  Chris Burdess  <dog@bluezoo.org>

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

Index: gnu/xml/dom/ls/SAXEventSink.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/xml/dom/ls/SAXEventSink.java,v
retrieving revision 1.1
diff -u -r1.1 SAXEventSink.java
--- gnu/xml/dom/ls/SAXEventSink.java 2 Feb 2005 00:42:09 -0000 1.1
+++ gnu/xml/dom/ls/SAXEventSink.java 10 Mar 2005 19:35:43 -0000
@@ -486,6 +486,13 @@
       {
         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);
   }



More information about the Java-patches mailing list