[Expat-discuss] Re: Bugs in expat 1.95.8

Steinar Bang sb at dod.no
Tue Dec 14 22:09:34 CET 2004


>>>>> Enrico Weigelt <weigelt at metux.de>:

> * Karl Waclawek <karl at waclawek.net> wrote:
> <snip>
>> >Nevertheless its bad behaviour of expat and shall be fixed.

>> For saying this, the wrath of the XML gods will come upon you. ;-)

> I really dont care about such fundamentalists. XML is a text format,
> and those normally have dozens over newlines. I dont see where
> kindly accepting some additional newlines makes any trouble. Expat
> is per definition an non-validating parser and thus is not intendet
> for syntax checking.

No, but it is a well-formedness checking parser.  And well-formed XML
MUST start with "<?xml", and can only be preceeded by a BOM.
	http://w3.org/TR/2004/REC-xml-20040204/#sec-well-formed
	http://w3.org/TR/2004/REC-xml-20040204/#charsets
(for the first link follow the "prolog" link in the BNF production).

Look at it as a "magical number" if you will.  PostScript files start
with "%!PS", PNG file start with "‰PNG
", etc.

If you change this, it is no longer a well-formedness checking parser.



More information about the Expat-discuss mailing list