Dorothea Salo on semantic HTML
8th January 2003
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.
More recent articles
- My AI/LLM predictions for the next 1, 3 and 6 years, for Oxide and Friends - 10th January 2025
- Weeknotes: Starting 2025 a little slow - 4th January 2025
- I still don't think companies serve you ads based on spying through your microphone - 2nd January 2025