Anne van Kesteren

XHTML advocates considered erroneous

Got to love Firefox 1.6a (Gecko 1.9) and Blake Kaplan. People trying to use XHTML syntax in a HTML document now get red, the color of error, back. And please don’t tell me that HTTP has nothing to do with it. That it is about the source code and such and about validation. Blah! I talked about coffee and MIME types before, no need to reiterate it. I also explained how browsers see the world. Seems sufficient. Anyway to take the source code of XHTML advocate pur sang, Faruk Ateş, as example:

Image showing lots of red slashes because tags are written in an XML way instead of an HTML. Result of giving the page a text/html MIME type.

I foresee lots of people digging up ancient W3C notes they should not be quoting at the moment and probably complaining that XHTML through an HTML parser is perfectly fine et cetera, et cetera. That namespaces are irrelevant and the differences in the DOM can be considered minor. I, for one, can appreciate the new Firefox behavior though.

Here is a story for you. You are one of those people who does not care about this shit. You use XHTML 1.1 and think it is all nice and dandy. The website you created displays beautifully cross browser and you got some Google points through fan boys. You also use the xml:lang attribute for accessibility purposes but you do not realize that no browser will ever recognize it as such. Oops. Now comes the culprit. The attribute that ends up in the DOM is not the lang attribute in the XML namespace which can then be passed on to accessibility applications. No it is the xml:lang attribute as string literal not in a namespace. If that last bit is a bit too hard for you please try this example:

<!DOCTYPE html>
<html xml:lang="nl">
 <style>
  p { background:lime }
  p:lang(nl) { background:red }
 </style>
 <p>This line should have a green background.
</html>

Time for another story. Although the above is all very relevant. Firefox 1.6a will most likely turn into Firefox 3, given the current roadmap, and that will take some time before it is released.

(XHTML advocate in this article refers to people following it, but not following the XML part.)