Hooray for standards

Jacob Kaplan-Moss

April 9, 2009

Hey, look, it’s a new W3C site.

Hm:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Ooh, XHTML

$ curl -sI http://beta.w3.org/ | grep 'Content-Type'
Content-Type: text/html; charset=utf-8

Heh.

Comments:

Joe Tyson:

Fail.

James McKay:

Sad isn't it, how you have to do crazy things like that just to satisfy cranky old Microsoft browsers?

Nathan Borror:

I really wish people would stop using the XHTML doctype.

Joshua Works:

I fully switched to using <! DOCTYPE html> a few months ago and it's so refreshing to have a clean intro to all my markup.

JanC:

Serving XHTML 1.0 Strict as text/html is perfectly valid, so what's the problem? (Go read the specification!)

Gábor Farkas:

the problem is that browsers will render it as an invalid HTML4 (not xhtml) page.

Jacob Kaplan-Moss:

"The 'text/html' media type [RFC2854] is primarily for HTML, not for XHTML. In general, this media type is NOT suitable for XHTML except when the XHTML is conforms to the guidelines in Appendix A. [...]

XHTML documents served as 'text/html' will not be processed as XML [XML10], e.g., well-formedness errors may not be detected by user agents. "

(http://www.w3.org/TR/xhtml-...)

Leave a comment:

Use your real name, or risk deletion.

Optional.

No markup allowed. Linebreaks will be converted; links will be linkified.

Be nice; don't be that guy.