Anne van Kesteren

XHTML2: the good and the ugly

This little piece of text is about the last XHTML2.0 working draft. As it stands now, that version is not backwards compatible with older versions of (X)HTML.

The previous post was about books. I made a simple ordered list and after a comment by Simon Jessey I decided to eliminate number 2. It is currently impossible to delete (with valid markup) the second li element. In XHTML2 you can and you can do more. You can also change the contents, where you would now have to delete the old content and insert the new content. And since you don't always want to keep the old content (spelling mistakes), this is a good option and I think this change in markup is correct and great to have for XHTML2.

The most stupid XHTML2 thing is this: links and external style sheets. First of all, a device should only recover the style sheets with the media type that applies to that particular device. My Mozilla web browser should for example only retrieve SCREEN and PRINT and not apply them at the same time. I don't want any AURAL style sheet it is not useful for me and I have to think about kb's.

That is 1, the second thing that is stupid is that this version is not backwards compatible so we don't need any link element taking care of our style sheets. We have a XML style sheets mechanism for that. link elements are great, don't get me wrong, but they should not be used for associating style sheets in an XML document.

There is also this style element, which should not have the type attribute. This particular attribute should be set on the PI, since it is an XML document. I sometimes see that people think that:

<style type="text/css" src="style.css"/>

Is the same as using a PI or a link element. It is not. The src attribute only applies to the element it is applied on and all descendents of that element. In this case, only the style element itself and so this has no use and is no way of applying a additional external style sheet.

(be sure to check out: HTML House of Horror: Things That Go <BLINK> in the Night, W3C Requests '906 Patent Re-Examination, The X-Philes, dive into mark (in a browser that supports border-radius) and mose menus (great way to show people how you can make things nice for other browsers than IE, bad thing is that I don't like Opera that much, they are so different :-), but I must say they are improving fast)


  1. And even more border-radius...

    Posted by Robbert Broersma at