Re: Incorrect Content-Type

Aristotle Pagaltzis <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Hi Brent,

* Brent Clark <[email protected]> [2009-02-11 16:15]:
> Quick question ... is it valid to send XML syntax etc, BUT the
> Content Type in the HTTP header is html.
>
> Im saying no, but my colleague it saying its ok.

well, it depends on what you want to happen. Be aware that if you
send it as `text/html`, it will be parsed as HTML. No exceptions.
As far as the browser cares, it will consider the document to be
HTML – malformed HTML, but HTML. The browser will not apply the
same character set detection rules as for XML (this can be a
security hole), it will not check well-formedness, it will apply
CSS in a subtly different way, the DOM generated from the
documented will differ, etc.

This is almost never what people actually want.

But in your case maybe it is.

For user agents other than browsers, sending XML as HTML is quite
simply wrong.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
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.