SAXParser causes a null pointer exception when using internal DTD declaration?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nitish_Naharas
Posted On:   Friday, July 27, 2001 02:01 PM

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"?> <!ELEMENT InboundRequest (APIHeader, BusinessObject)> <!ENTITY % APIHeader SYSTEM "APIHeader.dtd"> %APIHeader; <!ENTITY % BusinessObject SYSTEM "Catalog.dtd"> %BusinessObject; ]> the exception when trying to   More>>


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"?>



<!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

   <<Less
About | Sitemap | Contact