[uf-discuss] Best Practice for fn and n?

Costello, Roger L. costello at mitre.org
Sun Nov 5 06:49:08 PST 2006


Thanks Brian.  I intuitively figured there was something wrong with
using an empty abbr element.

In fact, my first attempt was to do just as you suggest.  However, I
realized that there is a problem with that.  Namely, when all the
values are concatenated together we get this value for fn:
Mr.JohnQ.PublicM.D.

That is, no space between the parts.

One solution would be to add a space after each part:

<span class="vcard">
       <span class="n fn">
             <span class="honorific-prefix">Mr. </span>
             <span class="given-name">John </span>
             <abbr class="additional-name" title="Quinlin">Q. </abbr>
             <span class="family-name">Public </span>,
             <span class="honorific-suffix">M.D.</span>/>
       </span>
 </span>

Then the concatenation of the values will yield the desired fn: Mr.
John Q. Public, M.D.

However, I don't like that solution either, because now the given name
is "John ", rather than "John", and the family name is "Public ",
rather than "Public".  This extra whitespace could be a killer for
tools that do value-added hCard services.

Any suggestions on how to solve this problem?  

/Roger

-----Original Message-----
From: microformats-discuss-bounces at microformats.org
[mailto:microformats-discuss-bounces at microformats.org] On Behalf Of
Brian Suda
Sent: Sunday, November 05, 2006 9:13 AM
To: Microformats Discuss
Subject: Re: [uf-discuss] Best Practice for fn and n?

Having empty elements is a bad idea. TIDY will outright remove empty
<abbr/> elements, plus it goes against Human-readablity. For all the
same reasons META elements get state, empty inline elements will get
state as well.

Why not just use class="n fn", you are displaying all of the 'n' data
inside your empty 'abbr', so why not just remove the 'abbr' and move
the class='fn' to the same data as the class='n'

 <span class="vcard">
       <span class="n fn">
             <span class="honorific-prefix">Mr.</span>
             <span class="given-name">John</span>
             <abbr class="additional-name" title="Quinlin">Q.</abbr>
             <span class="family-name">Public</span>,
             <span class="honorific-suffix">M.D.</span>/>
       </span>
 </span>


On 11/5/06, Costello, Roger L. <costello at mitre.org> wrote:
> Hi Folks,
>
> Here is some HTML text that I want to markup using the hCard fn and n
> properties:
>
>          Today's speaker is Mr. John Q. Public, M.D.
>
> I propose marking it up in this fashion:
>
> Today's speaker is
> <span class="vcard">
>       <abbr class="fn" title="Mr. John Q. Public, M.D." />
>       <span class="n">
>             <span class="honorific-prefix">Mr.</span>
>             <span class="given-name">John</span>
>             <abbr class="additional-name" title="Quinlin">Q.</abbr>
>             <span class="family-name">Public</span>,
>             <span class="honorific-suffix">M.D.</span>/>
>       </span>
> </span>
>
> Notice that I am using an empty abbr element to store the value for
fn.
> Is this sensible?
>
> Is there a better way to markup the HTML text?
>
> Is this Best Practice?
>
> /Roger
>
> _______________________________________________
> microformats-discuss mailing list
> microformats-discuss at microformats.org
> http://microformats.org/mailman/listinfo/microformats-discuss
>


-- 
brian suda
http://suda.co.uk
_______________________________________________
microformats-discuss mailing list
microformats-discuss at microformats.org
http://microformats.org/mailman/listinfo/microformats-discuss



More information about the microformats-discuss mailing list