intothemiddle
Sep 17th 2007, 10:29 am
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 (http://juicystudio.com/article/content-negotiation.php)
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
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 (http://juicystudio.com/article/content-negotiation.php)
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