[uf-discuss] Simplifying hierarchy in hCard

Tantek Ç elik tantek at cs.stanford.edu
Wed Mar 29 07:24:52 PST 2006


On 3/29/06 3:14 AM, "David Janes -- BlogMatrix" <davidjanes at blogmatrix.com>
wrote:

> From the hatom-issues [1] discussion, Tantek writes:
> 
> | You can actually simplify that (one fewer span) with:
> | <span class="author vcard"><span class="fn">My Name</span></span>
> 
> Why shouldn't hCard support <span class="author vcard fn">My
> Name</span>? I.e. do we gain anything by that extra layer of hierarchy
> of spans?

David, this has been asked (at least once) before on the list (we should
probably add this to the microformats FAQ[1] and/or the hCard FAQ [2]), and
the short answer is, it breaks the ability to nest microformats.  E.g. even
with just hCard, we can put an hCard inside another hCard as its AGENT, and
that becomes impossible to parse if you collapse a property element (such as
fn) with the root class name element (vcard) itself, because then it becomes
ambiguous which hCard the "fn" applies to (the outer hCard, or the "agent"
hCard).

In short, properties of a microformat MUST go in descendant elements
*inside* the root class element of that microformat.  Similarly with
subproperties of a property (e.g. "region" must be on a descendant of
"adr").

Thanks,

Tantek

[1] http://microformats.org/wiki/faq

[2] http://microformats.org/wiki/hcard-faq



More information about the microformats-discuss mailing list