Next in thread → Next in month →

RE: [xml-dev] Is it a well-formedness error to use a character not in the encoding specified by the XML declaration?

From
Michael Kay <>
To
,
Date
2010-03-19T09:42:43
ID
<D9F7E61BB0B44440B898D4998689161D@Sealion>
Thread
RE: [xml-dev] Is it a well-formedness error to use a character not in the encoding specified by the XML declaration?
> So I don't think it is correct behaviour to fall back to any 
> character, including U+FFFD, especially silently.

It's not correct behaviour for an XML parser, certainly.

However, there may be cases where you want to put a repair step into your
processing pipeline that turns non-XML files into well-formed XML that the
parser will accept. It's better to fix such problems at source, but if you
can't, then trying to repair the data is an option. It's just not the job of
the XML parser to do this.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
Next in thread → Next in month →