I come back from holiday to find that the BBC now validates XHTML 1.0
Strict.
http://www.bbc.co.uk/http://www.bbc.co.uk/news/http://www.bbc.co.uk/news/uk-scotland-10739868
Impressive!
Is this the way to go? Not HTML 4.01 strict?
No, this is not the right way to go, because it is not served
properly. If you validate at W3C and select "show source" and "verbose
output" under "more options" you find content type is "text/html".
Thus the page is being parsed as just html, not xhtml, and you would
better use html 4.01 strict in the first place. To serve the page
properly as xhtml, you must associate some extension such as .xhtml
with a xhtml mime type since .html is used by most servers for
ordinary html pages. If you do this, the page is parsed as xml, which
is extremely strict. A tiny error such as not closing a tag can give
you an error report from the parser rather than a view of the page.
This is because an xhtml page must be capable of handling xml
properly. A valid xhtml page served properly will be displayed
properly by most modern browsers. The glaring exception is that no IE
browser including IE8 can display an xhtml page served properly, but
there have been rumors that IE9 may finally display a properly served
xhtml page. Thus you must provide a html page for IE. One way to do
this is to use a php include at the very top of the page. Using header
exchange, the computer asks the server if it will accept xhtml. If so,
the xhtml page is used. If not, the xhtml page is re-written using
regular expressions, etc. to make it valid html 4.01 strict, for
example.
Furthermore xhtml 1.0 (3 versions) is now quite old, and xhtml 1.1 has
been around quite a while. Since xhtml 1.1 is not much more difficult
than html 1.0, I can not see the point in using xhtml 1.0 at this late
date. In fact a higher version of xhtml has had some work done on it.
I did validate
http://www.bbc.co.uk/ at the W3C css validator. This
gives 18 css errors and 2700 warnings for the page.
I would guess that about 99% of pages that claim to be xhtml are
nothing of the sort. The w3c validator only checks to see if the code
validates as xhtml. It only will tell you if it is served properly as
xhtml if you find the proper mime type for it is used by the server
under "content type" at the W3C validator. Apparently many are not
aware of this.