RadioRadio
Thursday, January 2, 2003
[11:24:24 AM]
One of the interesting questions in the current drive to using "structure" in html, is what we use structure *for*.
Tantek Celik now makes each weblog post a list item. It's true that a weblog is an ordered list of posts, as a book is an ordered list of chapters, a chapter is an ordered list of sections, and a section is an ordered list of paragraphs. It's also true that a paragraph is an ordered list of sentences, which are lists of words, which are lists of letters.
Some structure may be useful to non-visual readers and robots -- using heading tags instead of visual-only markup is an example.
Some structure is useful for transformations. If you aren't editing the same sequence of bytes that your readers see, you can do more interesting things.
You could create a weblog xml language, so that when you write and edit, you are looking at (or generating) semantically meaningful tags. For example: <xblog> <blogitem date="" time="">text here</blogitem> </xblog>. From that, your weblog software would build all the necessary links and anchors, and translate down to html so that any old browser could read it. You could add even more structure, of course.
The problem with making up xml languages seems to be that the standard validation technology doesn't easily support mixing two document types. Eventually, that will be less of a problem.
But when you think of using more structure, why? The standard reason is to make maintenance easier by using transformations to generate the final version. If you don't use automated transformations, using more structure might still make maintenance easier. But is it *really* much of an advantage to use list tags with classes, rather than div tags with classes?
Tantek is doing a few tricky things.
Rather than using class names in lists, the nesting of the lists implicitly holds the meaning. An <ol> for the month contains <li>s for the days, which contain an <ol> for the day's items.
Then he puts the date and time into the value attribute of the list tags. Since the dates are in an ordered list, browsers should display the date as the number of the list item. The times are in an unordered list, so he has to repeat the time with a heading tag.
All of this seems like a useful exploration, but I wonder who benefits. You probably save a few styles in CSS. It seems like it would be easier to create with a wysiwyg html editor, but you would still have to specify a couple of class attributes or copy/paste. If someone extracted a block of the source to use in a different setting, is there any benefit, or would it just be harder to understand?
The fundamental issue seems to be that html was designed to indicate sections with heading tags at the start, but DOM (and XML) are desperate to wrap anything meaningful within a tag.
Tantek's stylesheet then uses the nested structure to apply styles:
ol.month li { clear:left; list-style:none } ol.month li { text-align:left;margin-top:2em } ol.month ol li { margin:0;margin-bottom:1em } ol.month ol ul li { margin:0 } ol.month ol ul ul,ol.month ol ul ol { margin:1em 0 1em 2em } ol.month ol ul ul li,ol.month ol ul ol li { margin:0 } ol.month ol ul ul li { list-style:disc } ol.month ol ul ol li { list-style:decimal }
*That* is the shape of things to come.
Copyright © 2003 Licentious Radio.
Last update: 2/9/03; 9:15:43 AM.