XML News from Sunday, February 1, 2009

The W3C XHTML2 Working Group has published the second edition of XHTML Media Types. Briefly:

  1. If the Accept header explicitly contains application/xhtml+xml (with either no "q" parameter or a positive "q" value) deliver the document using that media type.
  2. If the Accept header explicitly contains text/html (with either no "q" parameter or a positive "q" value) deliver the document using that media type.
  3. If the accept header contains "*/*" (a convention some user agents use to indicate that they will accept anything), deliver the document using text/html.

In other words, requestors that advertise they support XHTML family documents will receive the document in the XHTML media type, and all other requestors that (at least claim to) support HTML or "everything" will receive the document using the HTML media type. Dealing with user agents that satisfy none of these criteria is outside the scope of this document.