Hi all,
This commit fixes a bug where the entity resolver (if set) would be
used to open the top-level document when parsing an XML file. The
spec states that the parser will use the entity resolver before
opening any external entity _except_ the top-level document entity.
Cheers,
Gary
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.9147
diff -u -r1.9147 ChangeLog
--- ChangeLog 8 Mar 2007 11:11:49 -0000 1.9147
+++ ChangeLog 8 Mar 2007 11:14:53 -0000
@@ -1,3 +1,9 @@
+2007-03-08 Gary Benson <[EMAIL PROTECTED]>
+
+ PR classpath/30983:
+ * gnu/xml/dom/ls/DomLSParser.java (getInputSource):
+ Do not use the entity resolver to resolve the top-level document.
+
2007-03-07 Tom Tromey <[EMAIL PROTECTED]>
PR classpath/31057:
Index: gnu/xml/dom/ls/DomLSParser.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/xml/dom/ls/DomLSParser.java,v
retrieving revision 1.5
diff -u -r1.5 DomLSParser.java
--- gnu/xml/dom/ls/DomLSParser.java 26 Jan 2007 19:57:43 -0000 1.5
+++ gnu/xml/dom/ls/DomLSParser.java 8 Mar 2007 11:14:53 -0000
@@ -372,22 +372,6 @@
source = new InputSource(in);
source.setSystemId(systemId);
}
- if (source == null && entityResolver != null)
- {
- String publicId = input.getPublicId();
- try
- {
- source = entityResolver.resolveEntity(publicId, systemId);
- }
- catch (SAXException e)
- {
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- catch (IOException e)
- {
- throw new DomLSException(LSException.PARSE_ERR, e);
- }
- }
if (source == null)
{
URL url = null;