A couple of days back I blogged about some first impressions while skimming through the HTML 5 spec, and I made a note about its length, which partly stems for a whole slew of new tags such as <dialog>, <figure> etc.
I can certainly see them being useful in creating a somewhat featured vocabulary for creating semantic markup. Here is the example from the draft spec:
<dialog>
<dt>Costello
<dd>Look, you gotta first baseman?
<dt>Abbott
<dd>Certainly.
...
</dialog>
Ignoring the problem about this being invalid xml (Strange! Why doesn't the HTML 5 require valid XML?), I think there are a couple of issues I see with this approach overall.
First this introduces a new tag, which isn't going to be available in all browsers any time soon. So I wonder whether if developers are likely to use the new tag, or will they just continue to use the <dl> tag or other appropriate existing tags.
Second, as it stands, it doesn't really address a meaningful conversation scenario where it might be useful to identify the participants, time stamps etc. There are numerous examples of conversations in a general sense across the web - every blog post's comment stream is a conversation of sorts. Facebook's Wall-To-Wall feature is a conversation. A saved chat transcript is a conversation. The <dialog> tag doesn't really capture the common pieces of information that are typically represented in all these conversations.
Finally, the number of interesting semantics is huge; the number of possible tags is small... so you fundamentally need a way to define semantics and layer them on basic tags, at some point or the other.
During the holidays, I was reading about microformats to understand a bit more about the concepts and patterns at play. So immediately when I saw the <dialog> tag, I began wondering, isn't any value in describing the semantics of a conversation, already achievable today using some sort of microformats-based approach? My own definition of microformats is basically a set of patterns using existing HTML tags to convey semantic data and metadata embedded in your page content. The microformats.org site describes them as a set of simple, open data formats built upon existing and widely adopted standards. See that page for more about what they are and aren't, as well as other related content.
There isn't an hConversation or hDialog type of microformat agreed upon right now. But here is a rough sketch of how you might use microformats approach to get not only a working visualization supported by all browsers today, but at the same time, embed additional semantics. To clarify, this isn't some approved conversation microformat, but me being creative and mocking one up while writing this post. Who knows... something might even come out of this. :-)
<ol class="hConversation">
<li class="message">
<span class="participant">Nikhil</span>
<span class="messagecontent">...</span>
</li>
...
</ol>
You can now leverage common microformats patterns. For example, you can include time-stamps using the datetime pattern... so you get:
<ol class="hConversation">
<li class="message">
<abbr class="dt" title="2008-01-25T10:00:00">25th January, 2008</abbr>
<span class="participant">Nikhil</span>
<span class="messagecontent">...</span>
</li>
...
</ol>
Furthermore you could compose microformats as if they were building blocks. For example, you might want to identify the participants, and use the existing hCard microformat.
<ol>
<li id="participant1">
<span class="vcard">
<a class="fn name url" href="http://www.nikhilk.net">Nikhil</a>
</span>
</li>
...
</ol>
<ol class="hConversation">
<li class="message">
<abbr class="dt" title="2008-01-25T10:00:00">25th January, 2008</abbr>
<span class="participant vcard"><a class="include" href="#participant1">Nikhil</a></span>
<span class="messagecontent">...</span>
</li>
...
</ol>
The example above also shows linking to a hCard, rather than embedding it inline in the conversation, using the include pattern. The hCard microformat itself allows for various bits of information to be specified about the identity it corresponds to.
Over the years, I've increasingly become a fan of semantic markup as the basis for attaching presentation and behavior, achieving SEO etc. especially since starting work on ASP.NET Ajax. It is certainly interesting to think about how to convey the semantics of the data contained within a page rendering. Ultimately the success of these microformats is gated to whether they are broadly applicable, are standardized, as well as whether things like search engines or browser addins allow you to extract the semantics and do something interesting with them, to make it worth your while to put them in there. Sort of a chicken and egg problem here.
But to come full circle to HTML 5, personally I think it would be great to see new tags in HTML when they equate to new capabilities, features and user experiences in the browser (eg. the <video> tag or <input type="date" />), rather than simply higher level tags designed to convey semantics. In other words, I would argue: address the biggest limitations of HTML first with an HTML 5 Core spec.
Posted on Friday, 1/25/2008 @ 5:37 PM