So far I have been parsing XML files with DOCTYPE declarations and a
reference to a valid DTD.
When I set the parser validation feature to false AND remove the DOCTYPE
declaration from the file the parser event reporting seems to change,
because suddenly my ContentHandler does produce a different ouput
(basically the only element that arrives at my application is the
When I set the parser validation feature to false AND leave the DOCTYPE
declaration but let it point to an invalid/non-existent DTD I get an
error. Something about "an invalid DTD reference". This is kind of
unexpected since I thought the DTD would be ignored when the parser is
Could anyone point me to an explanation. I seem to make the wrong
assumptions about non-validating parsers?