You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ritu Raj Tiwari <ri...@yahoo.com> on 2005/03/01 21:04:15 UTC

Xerces 2.6.2 chokes on doc w/o DOCTYPE

I went from using xerces that ships as part of JDK 5
to Xerces 2.6.2. I parse using a validating parser,
setting my own entity resolver.

With JDK 5, this entity resolver would get invoked if
a document without a DOCTYPE declaration was
encountered.

With Xerces 2.6.2, I get a SAXException. It says it
enountered (my document's) root element when it was
expecting 'null'.

My current (ugly) hack is to modify
org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement()
to call doctypeDecl() with the specs of *my* DTD. This
simulates a DOCTYPE declaration and seems to do the
trick.

Does anyone know of a way to make xerces 2.6.2  go to
the entity resolver if DOCTYPE is missing?

Thanks.
-Raj

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org