[uf-dev] Embedded compound microformat edge case

Toby A Inkster mail at tobyinkster.co.uk
Mon Jul 21 13:36:31 PDT 2008


Gabriele Renzi wrote:

> Did you find these in the wild or just testing ?

Just testing.

> If we are just talking about theoretical things why not restrict the
> agent field to actually be agent+vcard? It greatly simplifies parsing
> and it doesn't seem limiting for authors.

Do you mean insisting on the "agent" class and "vcard" class being on  
the same element? All versions of Cognition up to and including alpha  
10 *do* insist on that, but in fact a lot of examples in the wild  
actually nest the vCard *within* the agent (i.e. not on the same  
element), which is why I've been working on changing things for the  
next release.

It's not such a problem with agent vCards, as agent is used fairly  
rarely in the wild (even though it's actually quite a useful  
property) - possibly because people don't know about it, and possibly  
because there are quite a few parsers that screw things up, copying  
some of the agent's details to the main hCard's details.

But there are other embedded microformats (e.g. hCard and hCalendar  
events within hReview items; hCards within hAudio contributors; etc)  
which are more common, so it's important to get this right.

As I say, the specific case which I mentioned, along the lines of:

	<div class="agent">
		<p class="vcard"></p>
		<p class="vcard"></p>
	</div>

Is very much an edge case, but it would be nice if we had a normative  
interpretation of it. Right now I'm saying that the first hCard is  
the real agent and the second is a separate hCard. If people really  
need two agents, then they should use:

	<div class="agent">
		<p class="vcard"></p>
	</div>
	<div class="agent">
		<p class="vcard"></p>
	</div>

-- 
Toby A Inkster
<mailto:mail at tobyinkster.co.uk>
<http://tobyinkster.co.uk>




More information about the microformats-dev mailing list