Bug 2911 - SAXParser causes a null pointer exception when using external DTD declaration using entities in DOCTYPE?
Summary: SAXParser causes a null pointer exception when using external DTD declaration...
Status: NEW
Alias: None
Product: Xerces-J
Classification: Unclassified
Component: SAX (show other bugs)
Version: 1.4.2
Hardware: PC other
: P3 blocker
Target Milestone: ---
Assignee: Xerces-J Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-07-30 20:02 UTC by Nitish Naharas
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nitish Naharas 2001-07-30 20:02:13 UTC
Hi,
I am using JAXP with Xerces-J 1.4.2.  When using SAXParser with external DTD 
declaration similar to the following xml code snippet, I am getting a null 
pointer exception in xerces-J 1.4.1 as well as 1.4.2. This occurs when the code 
to invoke parsing is executed i.e.
saxParser.parse(inputSource, new InXMLHandler());

The xml snippet is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE InboundRequest [
<!ELEMENT InboundRequest (APIHeader, BusinessObject)>
<!ENTITY % APIHeader SYSTEM "file:///c:/pr/APIHeader.dtd">
%APIHeader;
<!ENTITY % BusinessObject SYSTEM "file:///c:/pr/Catalog.dtd">
%BusinessObject;
]>

the exception when trying to run it is:
java.lang.NullPointerException
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1094)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:374)
at testclass.ParsingTest.main(ParsingTest.java:59)
at symantec.tools.debug.Agent.runMain(Native Method)
at symantec.tools.debug.MainThread.run(Unknown Source)

The XML code fully validates using XMLSpy 3.5.  I saw a similar post at 
lists.xml.org but there was no reply to it.  This seems to be a bug.

Regards,
Nitish