Dorothea Salo on semantic HTML
Dorothea Salo has posted her thoughts on Semantic HTML as well. Dorothea points out that while pre-defined tags (paragraphs, lists and so forth) are well defined it is easy to run in to problems when you start to define extra semantics via the class attribute. Start with something like
<code class="python"> and the chances are that six months down the line your list of custom classes will have spiralled out of control, and as tools and validators will not be checking your class names (for typoes and so forth) you’ll soon be in a whole world of trouble.
Seeing as Dorothea has years of experience as a markup expert, whereas I’ve only been using HTML correctly since last summer, I’ll take her word for it that this is a problem (it certainly makes sense). I’m not a huge fan of additional semantics via the class attribute, but if you want to expand XHTML it can look like the only option. Perhaps this is where the modularisation of XHTML can come in to play? Lachlan Cannon’s Inline XML story on ALA shows how namespaces can be used to embed custom XML information in an otherwise normal XHTML document, and it would be easy to build a simple CMS that could filter out this information before serving it to more simple web clients. Of course, this reintroduces the problem of having to define a custom XML vocabulary so in some ways it puts us back where we started.