You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Mu...@GDM.DE on 2000/07/25 13:08:20 UTC

No exception when there's no DTD


Xerces does not throw an exception if the XML document's DTD is not
available.

I need to do the following to check for this:

DOM_Document doc = parser.getDocument();
DOM_Element docElement = doc.getDocumentElement();
if(docElement.isNull())
{
        //Handle this error.
}

Previously I never had any need to call DOM_Element::getDocumentElement(),
so this seems non-intuitive. If it is allowed in the DOM specification,
could you change it so that it throws an exception?

Murray Cumming
murrayc@usa.net
www.murrayc.com