Re: Content Negotiation and validator

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:14 UTC