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

Axel Hecht <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.