Re: XMLHttpRequest overrideMimeType question..

Martin Honnen <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Liberty Development
Message-ID <[email protected]>

Lucky wrote:


> have seen the mass use of overrideMimeType('text/xml') when using the 
> XMLHttpRequest object.
> 
> I would really like to know WHY this seems to be some magic "band-aid" 
> for some peoples code, esp when they say it fixes many calls to even 
> HTML pages, that they would possibly never be a "well-formed" XMLDocument??

That band aid is usually not necessary if people have set up their HTTP 
servers to serve static or dynamically created XML documents with a 
known XML Content-Type like application/xml or text/xml.
But an XHTML 1.0 document can be served as text/html and then 
XMLHttpRequest would not parse it as XML and there it would help to use 
overrideMimeType to get XMLHttpRequest to parse the response sent as 
text/html as XML by calling overrideMimeType('application/xml') or even 
ovverideMimeType('application/xhtml+xml').

I don't think overrideMimeType will help in any way to parse HTML tag 
soup successfully with an XML parser.


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/
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.