logo       

Re: making mozilla's xml to behave in a non-standard way: msg#00014

mozilla.devel.xml

Subject: Re: making mozilla's xml to behave in a non-standard way

none wrote:


Marco Milanesi wrote:

hi, this is a strange question I know, but I hope to get some responses:

I have a web application that I can't modify. it outputs an xml to
the browser with newlines and spaces at the beginning of the xml.

now the question. How can I modify this behaviour of mozilla? how can it
be more tolerant to this malformed xml?


It is not malformed. It is legal to put whites characters before the <?xml .. tag
It's mozilla which needs fixing, as many other buggy xml parsers.


Actually, could you quote the spec? Or tell me how I quote wrong?

From XML 1.0 3rd edition:


http://www.w3.org/TR/2004/REC-xml-20040204/#sec-well-formed

[Definition: A textual object is a well-formed XML document if:]
1. Taken as a whole, it matches the production labeled document.
...

http://www.w3.org/TR/2004/REC-xml-20040204/#NT-document

[1] document ::= prolog element Misc*

http://www.w3.org/TR/2004/REC-xml-20040204/#NT-prolog

[22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S?
'?>'

As you can see, there is no whitespace in front of the XMLDecl.

Axel


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise