W3C home > Mailing lists > Public > public-webapi@w3.org > April 2006

Re: XMLHttpRequest.responseXML and invalid XML documents

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Sun, 23 Apr 2006 21:41:59 -0500
Message-ID: <444C3AF7.60705@mit.edu>
To: "Hallvord R. M. Steen" <hallvord@opera.com>
CC: public-webapi@w3.org

Hallvord R. M. Steen wrote:
> Spec says about responseXML :
> 
>> If the document was not an XML document, or if the document could
>> not be parsed (due to an XML well-formedness error or unsupported
>> character encoding, for instance), returns null.
> 
> All major browsers return an empty document instead under most of
> these conditions.

Gecko doesn't ever return an empty document from XMLHttpRequest.  Sometimes it 
returns a bogus document with some "parseerror" markup in it due to 
<https://bugzilla.mozilla.org/show_bug.cgi?id=289714>; that's a bug that needs 
to be fixed.  But the document is never going to be completely empty; see 
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/xmlextras/base/src/nsXMLHttpRequest.cpp&rev=1.147&mark=1431-1433#1425

> - FireFox *does* return null if the document is sent as text/html

Or anything else that doesn't look like an XML MIME type.  Or if a network error 
occurs.  Or if the user cancels the load.  An so forth.

-Boris
Received on Monday, 24 April 2006 02:42:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT