HTML5 renders XHTML mimetypes invalid?

Internet

I’ve configured my web server to return XHTML to good browsers, and HTML to crappy ones. You know which ones go into each camp.

Running the XHTML version through the W3C Validator:

Line 12, Column 68: Bad value Content-Type for attribute http-equiv on XHTML element meta.

<meta http-equiv="Content-Type" content="application/xhtml+xml" />
http://www.w3.org/TR/xhtml-media-types/

So I went to the prescribed page on XHTML media types.

I suppose you mean

<meta http-equiv="Content-Type" content="application/xhtml+xml" />

(otherwise a different error message is issued).

The message might be somewhat obscure, but it corresponds to the HTML5 
draft. So any complaints should be directed to people working on HTML5 
rather than to the validator. Reference:
http://www.w3.org/TR/html5/the-meta-element.html#pragma-directives

Well, this is awkward.

The good news is its the fault of HTML5, rather than the validator.

HTML5 is billed as a living spec. I suppose that means its like kudzu, and grows onto other things. Or maybe it’s like water, and splashes onto other things. Either way, really not sure what that spec has to do with an already codified standard.

Author bio and support

Me!

Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.