[uf-discuss] More responses to slashdot comments

Michael Leikam leikam at yahoo.com
Thu Jul 13 11:40:56 PDT 2006


--- Sho Kuwamoto <skuwamot at adobe.com> wrote:

> Example A:
> --
> <div class="hreview">
>  <span><span class="rating">5</span> out of 5
> stars</span>
>  <h4 class="summary">Crepes on Cole is awesome</h4>
>  ...
> </div>

[snip]

> Example B:
> --
> <div class="hreview">
>  <span><span class="rating">5</span> out of 5
> stars</span>
>  <span class="summary">Crepes on Cole is awesome</span>
>  ...
> </div>
> 
> Ostensibly, the reason for preferring example A over
> example B is that
> there are two systems of semantics for two different
> reasons. The HTML
> view of the document says that the header is an h4. The
> microformats
> view of the document says it's a "summary". Example A
> allows both views
> of the document to live together.


<span>s and <h4>s are not structurally equivalent.  span
and div tags are general structural markup, while heading
tags are specifically defined in relation to other heading
tags.  Collectively they define an outline for the page,
while the set of spans on a page defines nothing.

Sure you can create a stylesheet that instructs a browser
to render the two in the same way, but you are sending a
document with a different structure.  What if the user has
other ideas on rendering heading tags, wants to extract a
page outline programatically, or isn't using a CSS
compliant browser?  In those cases, the structual
differences make a pragmatic, presentational difference
that can affect usability.


> This is essentially the same issue that people have with
> hacks like
> adding <div class="topleft"> into a document, which is
> clearly presentational. 

That may be an unfortunate choice of class name, but one of
the uses of class names is as a style sheet selector[1] so
I hardly see that as a hack.  Web pages have an inherent
presentational aspect and coding specifically to address
that isn't something to discourage.

Should we aspire to publishing elegant HTML?  Sure, but
it's not the only goal or, I'd say, even the primary one.

-ml

[1] http://www.w3.org/TR/html401/struct/global.html#h-7.5.2


More information about the microformats-discuss mailing list