Re: SV: Latest version of XHTML

On Saturday 08 March 2003 9:50 am, Jesper Tverskov wrote:
> I have for almost a year used what I regard as valid XHTML 1.1. At least
> the W3C online validator says so. I do not know what exactly is meant by
> "It shouldn't be served as text/html".

It may very well be valid XHTML 1.1.  That is not the issue.

When a web server sends your browser a file, it labels it with a mime-type to 
let your browser know what kind of file it is.  You have things like 
image/png, text/plain, and text/html.  These are all clearly defined in 
various RFCs.

The text/html mime-type is what most browsers currently understand to be HTML, 
so you are pretty much forced to use text/html if you want your website to be 
viewed by most people on the web.  text/html is defined in RFC 2854 as being 
either HTML or XHTML 1.0, following Appendix C.  Some people even think that 
XHTML 1.0 served as text/html is a mistake, but it's a mistake condoned by 
the relevent specifications.

There is no provision made for XHTML 1.1.  This is because the more accurate 
mime-type application/xhtml+xml is now available.  This is defined in RFC 
3236.  If you send XHTML 1.1, you should use this.  When sending a file as 
text/html, a file is treated as ordinary HTML tag-soup, not XHTML.


> Please take a look at my Danish website: www.klapmusen.dk, and tell me in a
> way I can understand why it is not valid XHTML 1.1.

It is probably valid XHTML 1.1 (I didn't check).  It isn't text/html though, 
which is what your server claims it to be.  The more correct approach would 
be to either revert to XHTML 1.0, following Appendix C, or change the 
mime-type sent by your server to indicate that it is XHTML (which will 
probably cause you quite a few problems).

In practice, if you follow the rules in XHTML 1.0 Appendix C, you shouldn't 
have any real trouble by mislabelling it, however there really isn't that 
much difference between XHTML 1.1 and XHTML 1.0 Strict, so it's hard to make 
a case for doing so.

-- 
Jim Dabell

Received on Saturday, 8 March 2003 05:31:21 UTC