Hi,
when using SAXParser with internal DTD declaration similar to the following xml code snippet, I am getting a null pointer exception in xerces 1.4.1. 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"?>
<!-- edited with XML Spy v3.5 NT (
http://www.xmlspy.com) by Joe Coveney (Indus International) -->
<!DOCTYPE InboundRequest [
<!ELEMENT InboundRequest (APIHeader, BusinessObject)>
<!ENTITY % APIHeader SYSTEM "APIHeader.dtd">
%APIHeader;
<!ENTITY % BusinessObject SYSTEM "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)
Have you come across this problem? Any tips/pointers for me?
Regards,
Nitish