Hi All, I've been over this in numerous sites, and seen various discussions about it - after a while I thought I'd try to complete a true XHTML 1.1 strict page. Although I vary between following HTML and XHTML standards depending, I always served the sites as text/html mime types, and just content that the page itself was compliant to a standard of code. However, having had access to a server with more allowance to mess about with, I today managed to create not only a site which has XHTML as the file extension, which IIS reads through the asp.dll. Then to add the content type I used script from juicystudio to feed the correct type based upon if its accepted. (I reversed this conditional statement as below). --- asp code --- If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/xhtml+xml") = 0 Then Response.ContentType = "text/html" Else Response.ContentType = "application/xhtml+xml" End If --- However, having set the server up for xhtml extensions, added the right content type in the script, and made XHTML 1.1 strict code, mime types, and what not... I check this on the w3c validator and still get; "Conflict between Mime Type and Document Type The document is being served with the text/html Mime Type which is not a registered media type for the XHTML 1.1 Document Type. The recommended media type for this document is: application/xhtml+xml" Is this just the w3c validator not displaying a valid content type within its HTTP_ACCEPT? I'm sure there's a whole bunch of you who hate XHTML and this discussion, but I've got this far and annoyed that it's misbehaving. (it's also mysteriously made my background white since adding in this HTTP_ACCEPT detection, but that seems unimportant right now.) Thanks, Rob
Had the same issue. I recall the W3C validator not sending a HTTP_ACCEPT value or simply */* instead of specifically inserting application/xhtml+xml into the list, so your content negotiation conditional doesn't trigger. The validator still says its valid and you know that capable browsers are being sent the correct mime type so it is okay for most purposes. One option is to blacklist user agents that do not support XHTML as an XML mime type, and serve the correct application/xhtml+xml type by default.
Hi KRT, Thanks, that's what I suspected but wanted to be sure as it's the first time I've bothered to go to such lengths to get rid of the w3c warning. Thanks Rob