Re: Incorrect Content-Type

Tod Harter <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
It is not a real good idea when dealing with web browsers for sure. It is
bad practice in ANY case, but supposing whatever application is consuming
the data doesn't complain, then in that sense it is "OK".

As for what will actually happen? That will depend on several factors. What
exactly is IN the XML document? If it specifies a DTD or a schema that might
make a difference (especially with IE, which practically ignores mime
types). With mozilla based browsers, it will attempt to render it, but again
success is dependent on what it sees. If your XML declares name spaces the
browser recognizes, it may render some part of it.

On Wed, Feb 11, 2009 at 12:06 PM, Wayne Simmons <[email protected]> wrote:

> Brent Clark said:
> >Quick question ... is it valid to send XML syntax etc, BUT the Content
> >Type in the HTTP header is html.
> >I'm saying no, but my colleague it saying its ok.
>
> Define "valid" and "ok" these are very ambiguous terms:
>
> Will the data reach the client? Yes (so is it ok?)
> Will the webserver allow you do this? Yes (does this mean it's valid?)
>
> Perhaps your question should be:
> What will a client browser do with XML data that has a content type of
> HTML?
> or
> Will the client attempt to render the content as HTML or will it show as an
> XML document?
>
> I suspect that your answer to those might depend on which browser you're
> using.
>
> I'll add:
> Is it something that SHOULD be done, or is it something that's unexpected
> and inexact? I think it's pretty clear this is unexpected and at the very
> least inexact, and therefore shouldn't be done.
>
>
> -Wayne
>
> --
> Software Engineer
> InterSystems USA, Inc.
> 303-858-1000
>
>
> _______________________________________________
> Perl-XML mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>



-- 
The Wise adapts himself to the world. The Fool adapts the world to himself.
Therefore, all progress depends on the Fool.

_______________________________________________
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.