[microformats-discuss] hCard clarifications

Brian Suda brian.suda at gmail.com
Wed Jul 20 05:19:25 PDT 2005


On 7/20/05, Eran <limbo at speakeasy.net> wrote:
> Looking at the specs for hCard and at some of the examples I've come
> across a slight variations, I'm looking at complex elements like adr.
> 
> http://www.crowley.nl/hcard.html includes an adr field composed of
> several "sub"-fields (although it neglects to separate them with a
> semicolon):

The semicolons are not needed, those are added by the transforming
program. The semicolon is just a sperator in vCard. In HTML the
individual tags act as the seperators.

> 
> <div class="adr">
>  <div class="street-address">Waarderweg 52d</div>
>  <span class="postal-code">2031BP</span>
>  <span class="locality">Haarlem <abbr
> title="Netherlands">NL</abbr></span>
>  </div>
> 
> http://home.alltel.net/jackwolfgang/blog/2005/06/microformats-resume-upd
> ate.html used the sub-fields without the containing adr field:

This is actually incorrect, an additional <... class='adr'></...> is
needed wrapped around all the postal information.

> <div class="vcard Centered">
>  <a href="http://home.alltel.net/jackwolfgang/" target="_self"
>  class="url fn n" rel="me">
>  <span class="given-name">Jack</span> L.
>  <span class="family-name">Wolfgang</span>
>  II</a><br />
>  <span class="locality">Cairo</span>,
>  <span class="region">Georgia</span>,
>  <span class="country-name">
> 
>  <abbr title="United States of America">USA</abbr></span>
>  <span class="postal-code">39827</span><br />
>  <a href="../contact/" target="_self" class="email">E-Mail
>  via Web Form</a><br />
> </div>
> 
> Are both correct? What exactly are the rules for using complex fields?

No, the second one is not correct.

> While I'm here, another question on multiple classes. For example the
> following element:
> 
> <a href="http://home.alltel.net/jackwolfgang/" target="_self"
>  class="url fn n" rel="me">
>  <span class="given-name">Jack</span> L.
>  <span class="family-name">Wolfgang</span>
>  II</a>
> 
> What are the rules for interpreting the "url fn n" class string? Is
> there a relation between the order of classes in the class string and
> the href & text properties of the A element?

That is very acceptable, in the case of URL, since the 'a' is the most
semantic, the information is retrived from the href, but in the case
of fn and n the string Jack ... is used.

There is no exact rule on what follows what. In X2V for certain
properties certain attributes are looked at first. For dtstart, dtend,
dtstamp and other date-time elements the title='' element is looked at
first, for URL and eMail, the href='', for images the src='', for
others the node value is used or something like alt, or longdesc, etc.
There is not an exact science to it yet.

-brian

-- 
brian suda
http://suda.co.uk


More information about the microformats-discuss mailing list