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 "Williamson, Siehnai" <sw...@docucorp.com> on 2001/08/21 20:58:03 UTC
contradictory encoding warning creates later error that doesn't g
et thrown
Hi,
I'm having a problem when there are SAX parser warnings. It appears that
processing continues in the case where the encoding scheme mentioned in a
document is not its true encoding. The SAX parser does throw a warning to
my error handler, but then continues to attempt to parse with a NULL
encoding string value which causes an access violation error.
First, shouldn't a contradictory encoding be an "error" rather than a mere
"warning"? Second, if these are considered mere warnings, then how do I get
processing to halt after a contradictory encoding has been discovered?
Siehnai Williamson
DocuCorp International, Inc.
Re: contradictory encoding warning creates later error that doesn't g et thrown
Posted by Derek Harmon <lo...@msn.com>.
"Williamson, Siehnai" wrote:
> First, shouldn't a contradictory encoding be an "error" rather than a mere
> "warning"?
XML Sect. 4.3.3 appears to agree. I don't know if the SAX
specification lightens up on this requirement for any reason.
Although, an "error" (as opposed to a "fatal error") need not
halt processing.
> Second, if these are considered mere warnings, then how do I get
> processing to halt after a contradictory encoding has been discovered?
Examine the SAXParseException that you receive when the warning( )
method of your ErrorHandler implementation is called, using the
getMessage( ) accessor. If the warning message is suggestive of
a contradictory encoding scheme, then call your ErrorHandler's
fatalError( ) method (in essence, promote the warning to a fatal
error.)
Derek Harmon
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org