[uf-discuss] hCard parsing rules

Brian Suda brian.suda at gmail.com
Mon Oct 23 05:06:03 PDT 2006

On 10/23/06, Mike Linksvayer <ml at creativecommons.org> wrote:
> On Sun, 2006-10-22 at 12:17 +0000, Brian Suda wrote:
> > <a href="http://example.com" class="url">my homepage</a>
> > is the same as:
> > <span class="url">http://example.com</span>
> Really?

I think the best reference at the moment for how to extract data is
the hcard-parsing page (http://microformats.org/wiki/hcard-parsing), I
think you talked your way into understanding the concept, but i'll try
a few more examples that might help you.

<span class="given-name">Joe</span>
<span class="additional-name">Quincy</span>
<span class="family-name">Public</span>

and the following are the same in vCard

<span class="given-name">Joe</span>
<abbr title="Quincy" class="additional-name">Q</abbr>
<span class="family-name">Public</span>

Depening on what the element is, and what the property is, there are
certain places to look when extracting the data. In the first case, it
is a span, so the data is extracted from the node-value. In the second
example, it is on an abbr element, so the title is used.

<span class="given-name">Joe</span>
<img alt="Quincy" class="additional-name" src="/images/q.png" />
<span class="family-name">Public</span>

This would also decode as the same values as the others, it is an img
element, so we look to the alt attribute. Now, depending on the class
value we could have used the src value or the alt value. That depends
if the hCard property is looking for a string (alt) or a URL (src).

If you still have


brian suda

More information about the microformats-discuss mailing list