Re: HTML and XML

Julian Reschke wrote:
> Elliotte Rusty Harold wrote:
>> ...
>> On this point, I have to call B.S. again. That a document is served as 
>> text/html does not make it HTML. Much less does it make it not XML. If 
>> a document satisfies the BNF grammar and the various well-formedness 
>> constraints, it is XML, whatever you call it. It may also be HTML, and 
>> perhaps other things as well.
>> ...
> Depends on whether you concentrate on the octet sequence alone, or add 
> metadata, as served by HTTP. In the latter case it's certainly *not* BS.

It absolutely is B.S. Were I to serve an XML document as image/jpeg 
would that make it a JPEG? Of course not. Were I to serve a JPEG as 
text/html would that make it not a JPEG? of course not. This is obvious. 
  HTML and XML just happen to be close enought hat this point is 
sometimes obscured because some things really can be both, and because 
browsers often deliberately obscure there processing model.

>> The MIME type is not normative. That someone has labeled a document as 
>> one thing or another does not make it that thing.
> It totally is. By sending XHTML as text/html I'm asking the recipient to 
> handle the document as text/html.

"Please handle this document as X" and "This document is an X" are very 
different statements. Furthermore, it is essential to realize that 
browsers and other consumers are not obligated to accept suggestions 
about handling from the server. They can and do treat any document they 
receive in the way that makes most sense to them.

A lot of the electrons spilled on this topic are based on the fantasy 
that servers can somehow impose required processing or understanding on 
a client. They can't. Servers may suggest and offer hints, but they 
cannot demand. Clients will do what makes the most sense for the client. 
Sometimes that's what the server expects them to do. Sometimes it isn't.

Elliotte Rusty Harold
Refactoring HTML Just Published!

Received on Wednesday, 11 February 2009 14:47:50 UTC