Actually, the fact that it was able to tell that you gave it a contradictory
error means that it was able to understand what it really was, so it tries
to continue. If it couldn't figure out what it was (and it does this in
normal cases as well, when you don't provide an XMLDecl), it would have just
gone ahead and then died in a major way when it started decoding what seems
to it like garbage.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
[EMAIL PROTECTED]
http://www.charmedquark.com

"Why put off until tomorrow what you can
put off until the day after tomorrow?"

----- Original Message -----
From: "Will Pugh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 12:04 PM
Subject: Why is ContradictoryEncoding a warning?


> I'm not sure what release I have (is there somewhere in the sources I can
> look to determine the version?), but I'm getting a crash when someone
> creates a bogus XML file that is UTF-8 encoded, but has a
> <?xml version='1.0' encoding='UTF-16'?>
> in it.
>
> What appears to happen is that Xerces catches the error just fine in
> XMLReader::setEncoding,
> but then in DTDValidator::scanTextDecl, it calls emitError with the
> XML4CErrs::ContradictoryEncoding error passed in.
> Since XML4CErrs::ContradictoryEncoding is < E_LowBounds, emitError doesn't
> throw.
>
> Xerces then continues on, and crashes later in makeNewTranscoderFor,
> probably because fEncodingString was set to NULL in setEncoding.
>
> It seems to me that if you get a contradictory encoding, it should fail
> immediately; since otherwise, it would have to guess what the encoding
was,
> and could possibly be wrong.
>
>
> Thanks,
> --Will
>
> Westside: The platform for real business needs.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to