November 23, 2002
Semantic Overloading
How much power should we allow the CLASS attribute to have in providing semantic structure?
<h3 class="BlogPostTitle">First p0st!</h3>
Consider the dual nature of the above example. It’s a third-level header. It’s a blog post title. Let’s assume that for the moment that I’m using the H3 element strictly for structural, not presentational purposes (i.e. I don’t care how the H3 is rendered in your user-agent of choice). Is the semantic value of the “BlogPostTitle” class outweighing the structural value of the H3?
Anil Dash is proposing a syndication format for weblogs that builds on the foundation of XHTML. I think the idea is sound, but I have a problem with making certain XHTML elements “required.” For example, an H3 element makes no sense in a document that contains no H1 or H2 elements, so requiring that all post titles be delimited by H3 tags seems cruel and unusual.
The easy and obvious solution would be to standardize a set of CLASS attribute values and make those required. This method would allow any element to be a post body, post title or permalink. This is also where XML adherents would begin to get upset, because the practice of using the CLASS attribute to denote such deep semantic meaning is generally frowned upon. Ideally, you’d want a BLOGPOST element or something similarly specific.
So now we’re in some murky waters. RSS provides a decent set of elements for syndicating weblogs, but it requires compromises on the part of the author. Full disclosure: I don’t like providing an RSS feed. It’s messy, it requires me to change my authoring habits, and I’m half-convinced that, like SOAP, the only reason it exists is to create a market for tools. If aggregation via XHTML were easier, there wouldn’t be religious wars over syndication formats. But in order to get there, the rules that govern XHTML as a semantic metalanguage will need to be put to the test. Anil’s idea could be that test.
It could work, or it could flop. I don’t know, but I’m interested in seeing where it goes. So don’t worry, I’m not planning on hauling down my RSS feed anytime soon.
Related reading:
- Tantek Celik: XHTML vs. The World
- Stuart Langridge: XHTML instead of RSS
- Ian Hickson: Why semantic markup is so important












