W3C home > Mailing lists > Public > www-html@w3.org > March 2007

Re: Content Negotiation and validator

From: David Dorward <david@dorward.me.uk>
Date: Wed, 21 Mar 2007 19:23:29 +0000
Message-ID: <46018631.80100@dorward.me.uk>
To: Jasper Magick <jasper.magick@gmail.com>, www-html@w3.org, www-validator@w3.org

Jasper Magick wrote:

www-html is a mailing list for discussion of the development of the HTML
language - not HTML, not a tool that uses HTML. I'm CCing www-validator
and suggest follow-ups be directed there.

> Recently I've been using Content Negotiation on one of my sites so
> browsers that don't understand application/xhtml+xml get served text/html
> 
> But I was wondering, how come the validator (http://validator.w3.org/)
> doesn't recognize  the correct MIME type?

It does. You can serve content as application/xhtml+xml and the
validator will process it quite happily.

> When validating, it says it's text/html.  Shouldn't the validator
> be sending out headers just like any other user agent to say
> what MIME types it accepts?

It doesn't send an accept header, but the accept header *is* optional.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1

In fact, the specification says:

  If no Accept header field is present, then it is assumed that the
  client accepts all media types.

So it effectively /is/ claiming to support XHTML, but your content
negotiation system is putting a higher priority on HTML.

It might be worthwhile adding an accept header to the validator, since
currently it reports a "200 OK" status code and a message along the
lines of "Sorry, I am unable to validate this document because its
content type is ..." when the content-type returned by the server isn't
supported - so there likely is a list of supported content-types
available already.

However, and now we stray into areas which I don't know well. There is
now this magic "+xml" appendage that goes on the end of a content-type.
Should the validator be able to check application/foo+xml and look for a
Doctype in the XML document? If so, how could an accept header be
structured?



-- 
David Dorward                               <http://dorward.me.uk/>
Received on Wednesday, 21 March 2007 19:24:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:08 GMT