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 Dean Roddey <dr...@portal.com> on 2001/04/26 19:32:19 UTC

RE: PLEASE HELP: SAX parser errors on validation when ValScheme=V al_Never?????

> A non-validating processor is apparently
> allowed to attempt to read foo.dtd, but
> it MUST NOT be an error if the file is
> not found since a non-validating processor
> is NOT required to read the external sub-set.


Well, that logic isn't exactly ummm...logical :-) The fact that its not
*required* to read the external subset, doesn't mean that its required *not*
to read the subset either.

But anyway, the reason that is is the way it is right now is that there is
no way to report the error. The parser cannot, ever, ever, ever, silently
just ignore the DTD and continue, even if non-val, because the DTD could
very much change the resulting file.

So, we would have to have a way to say "hey, the DTD didn't exist, can I
continue?" But how will we do that? There's no DOM or SAX API to do this.
The only callbacks you use with SAX or DOM are the SAX defined callbacks. So
how can we report the error? We can't throw an exception, since that would
unwind the stack and there would be no way to restart.

If we cannot report the error, then the only way we could support it is by
having you tell us, up front before the parse, that we can unconditionally
ignore the DTD if not found, but that wouldn't suit many people's needs
either, because they don't know that they aren't going to find it.

So its not as easy as it sounds. Anything that we would do would be
non-standard, and non-portable, unless an API was provided to do it. And, in
a way, that API already exists in the form of the entity resolver. That's
one of the things its to be used for.

--------------
Dean Roddey
Software Geek Extraordinaire
Portal, Inc
droddey@portal.com

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