[TxMt] Misguided use of content-type in XHTML/1.1 template

Allan Odgaard throw-away-1 at macromates.com
Mon Mar 5 16:54:30 UTC 2007


On 5. Mar 2007, at 17:13, hadley wickham wrote:

> [...]
> If it's an xml file, doesn't that already imply the the content- 
> type is xml?

This is circular logic ;)

Also, we want to further specialize the type, i.e. it could be xhtml 
+xml (as in this case) or it could be rss+xml, that is what we need  
to specify.

> Isn't the content only important when you're sending things "over  
> the wire" so the program at the other end can recognise what to  
> do?  The meta tag is just a hack for html to give the page author  
> some way of overriding the content-type that the server is sending.

I don’t fully follow this. But the meta tag is not a hack, it is a  
way to specify the content type (and encoding, etc.) when the page is  
NOT sent over http, i.e. when it is loaded from a non-http server  
(like your disk drive). The meta tag never overrides the info sent by  
the server, on the contrary, it is the server which overrides the  
meta tag.

> There's a good discussion of xhtml here: http://www.hixie.ch/ 
> advocacy/xhtml.  I think this sums it up: [...]

Sure, XHTML is not useful on the net, etc. -- but what we are  
discussing here is how a correct XHTML 1.1 template should look,  
regardless of what the real-life treatment of XHTML for content sent  
over http is.

If we wanted to cater to the real-life situation, we should really  
just remove the XHTML support -- but a lot of people do want to use  
XHTML, and some may actually do it in an environment where it makes  
sense. For example some produce HTML 4 from their XHTML pages, which  
has the advantage that they can use the full XML tool suite with  
their content (when in the states prior to the final publishing step).





More information about the textmate mailing list