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

hadley wickham h.wickham at gmail.com
Mon Mar 5 16:13:28 UTC 2007


On 3/4/07, Allan Odgaard <throw-away-1 at macromates.com> wrote:
> On 5. Mar 2007, at 01:00, porneL wrote:
>
> > I've just noticed that template for XHTML/1.1 has been changed to
> > include application/xhtml+xml content type in <meta> element.
> >
> > This is completly misguided as <meta> is there only for backwards-
> > compatibility non-XHTML user-agents -- that is only those which *do
> > not* support application/xhtml+xml.
> >
> > From W3C XHTML FAQ:
> > "Note that a meta http-equiv statement will not be recognized by
> > XML processors, and authors SHOULD NOT include such a statement in
> > an XHTML document served as 'application/xml' (and 'application/
> > xhtml+xml' as well for that matter)."
>
> The reason it says SHOULD NOT (which means "not recommended", see RFC
> 2119) is that for an XML document, you declare the content type using
> processing instructions. Though I have no idea how the "content type"
> processing instruction looks, anyone?

If it's an xml file, doesn't that already imply the the content-type
is xml?  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.

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

"HTML 4.01 contains everything that XHTML 1.0 contains, so there is
   little reason to use XHTML in the real world. It appears the main
   reason is simply "jumping on the bandwagon" of using the latest and
   (perceived) greatest thing."

Hadley



More information about the textmate mailing list