Hi Lorraine,
I tried to reproduce your problem, but was unable to do so with either 1.4.3 or the latest Xerces-1 source in CVS. Which parser features do you have enabled?
The XMLParser.parse methods actually catch any exception that's neither an IOException nor a SAXException and wrap it in a SAXException; that's why your stack trace shows the failure as occuring in XMLParser.parse. If you catch that exception as follows, you can examine the stack trace for the NullPointerException itself. That should help determine where the problem lies.
try {
parser.parse(...);
}
catch(SAXException e) {
if (e.getException() != null) {
e.getException().printStackTrace();
}
}
Thanks,
Henry
------------------------------------------------------------------------
Henry Zongaro XML Parsers development
IBM SWS Toronto Lab Tie Line 969-6044; Phone (905) 413-6044
mailto:[EMAIL PROTECTED]
Please respond to [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: parser exception
Hello,
Below is a minimal xml file with a DOCTYPE declaration that succeeds if
xerces 1.3.1 is used but files with a Null Pointer Exception on any
later version of xerces (such as 1.4.3). The files x.dtd and y.dtd that
the prolog references exist but are empty. A stack trace shows that the
failure occurs in the parse method of XMLParser. This contrived test
case demonstrates the same behavior that our much larger xml file and
dtd's demonstrate when the xerces 1.3.1 and 1.4.3 parsers are used.
<?xml version="1.0" standalone="no" ?>
<!DOCTYPE document SYSTEM
"x.dtd" [
<!ENTITY % parament SYSTEM "y.dtd">
%parament; ] >
<document>
</document>
If anyone can shed some light on the reason for the error when using
xerces 1.4.3, I would really appreciate it.
Thanks,
Lorraine Callahan
