You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Ramesh <ra...@enode.com> on 2000/06/25 18:15:04 UTC

Bug in Xerces112; DOMParser.startElement()

Things that were working in Xerces 1.1.1 broke when I upgraded to 1.1.2.

On line 1078 in DOMParser.java, createDocumentType() is invoked without
checking if fDocumentImpl is null or if fGrammarAccess is enabled:

// copy schema grammar, if needed
if (!fSeenRootElement) {
    fSeenRootElement = true;
    if (fDocumentType == null) {
        String rootName = elementName;
        String systemId = ""; // REVISIT: How do we get this value? -Ac
        String publicId = ""; // REVISIT: How do we get this value? -Ac

*** NullPointerException here if fDocumentImpl is null:
=======================================================

        fDocumentType = fDocumentImpl.createDocumentType(
                                        rootName, publicId, systemId);
        fDocument.appendChild(fDocumentType);
    }
    if (fDocumentImpl != null && fGrammarAccess)  {
        //Document schemaDocument = fValidator.getSchemaDocument();
        ...
    }
}

I am setting the document-class-name property of DOMParser to my own
DocumentImpl replacement, so fDocumentImpl is null.

Even though I set the ".../validation" feature to true, I explicitly set
both the ".../validation/schema" and ".../domx/grammar-access" features to
false, but still got the exception.

How can I get around this problem?

Thanks for any help!

Ramesh

Re: Bug in Xerces112; DOMParser.startElement()

Posted by Andy Clark <an...@apache.org>.
Ramesh wrote:
> On line 1078 in DOMParser.java, createDocumentType() is invoked without
> checking if fDocumentImpl is null or if fGrammarAccess is enabled:

Thanks for the bug report. I have fixed the problem and the updated
code is in CVS.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org