hcard-brainstorming: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
= hCardBrainstorming =
__TOC__
== Authors ==
* [http://suda.co.uk/ Brian Suda]
* [http://tantek.com/log/ Tantek Çelik], [http://technorati.com Technorati, Inc]


= Examples =
* We should provide 1:1 hCard examples for each example in [http://www.ietf.org/rfc/rfc2426.txt RFC 2426].
== 2.4.2 VCARD ==
<pre><nowiki>
AGENT:BEGIN:VCARD\nFN:Joe Friday\nTEL:+1-919-555-7878\n
TITLE:Area Administrator\, Assistant\n EMAIL\;TYPE=INTERNET:\n
jfriday@host.com\nEND:VCARD\n
</nowiki></pre>
in hCard could be (hmm.. is AGENT something that needs special casing since it can occur *outside* of a VCARD?):
<pre><nowiki>
<span class="agent">
<span class="vcard">
  <span class="email">
  <a class="internet" href="mailto:jfriday@host.com">
    <span class="fn">Joe Friday</span>
  </a>
  </span>
  <span class="tel">+1-919-555-7878</span>
  <span class="title">Area Administrator, Assistant</span>
</span>
</span>
</nowiki></pre>
The outer agent & vcard spans could be easily collapsed however, and internet and fn could also be collapsed to use a single element as such:
<pre><nowiki>
<span class="agent vcard">
<span class="email"
  <a class="internet fn" href="mailto:jfriday@host.com">Joe Friday</a>
</span>
<span class="tel">+1-919-555-7878</span>
<span class="title">Area Administrator, Assistant</span>
</span>
</nowiki></pre>
this hCard could be displayed as:
[mailto:jfriday@host.com Joe Friday]
+1-919-555-7878
Area Administrator, Assistant
== 3.1.1 FN Type Definition ==
<pre><nowiki>
FN:Mr. John Q. Public\, Esq.
</nowiki></pre>
this vCard fragment in a complete hCard would be:
<pre><nowiki>
<span class="vcard">
<span class="fn">Mr. John Q. Public, Esq.</span>
<span>
</nowiki></pre>
== John Smith ==
<pre><nowiki>
BEGIN:VCARD
VERSION:2.0
N:Smith;John
FN:John Smith
TEL;CELL:314-123-4567
TEL;FAX:314-123-4568
TEL;WORK:314-123-4569
URL:www.example.com
org:Example Oragnization;Marketing and Communications
EMAIL;INTERNET:john.smith@example.com
TITLE:Director, Marketing & Web Services
ADR;;123 Main Street;Any Town;MO;12345;USA
NOTE;quoted-printable:"A personal signature here"
END:VCARD
</nowiki></pre>
This is one way to encode the vCard in HTML
<pre><nowiki>
<div class="vcard">
  <a href="mailto:john.smith@example.com">
  <span class="fn n">
    <span class="Given-Name">John</span>
    <span class="Family-Name">Smith</span>
  </span>
  </a><br />
  <!-- need to encode CELL, FAX, WORK -->
  <span class="tel">314-123-4567</span><br />
  <span class="tel">314-123-4568</span><br />
  <span class="tel">314-123-4569</span><br />
<p>I work for
<span class="org">
  <a href="http://www.example.com" class="Organizational-Name">Example Oragnization</a>
  in the <span class="Organizational-Unit">Marketing and Communications</span>
</span>
department as <span class="title">Director, Marketing &amp; Web Services</span>
</p>
<address>
  <span class="Street">123 Main Street</span><br />
  <span class="Locality">Any Town</span>,
  <span class="Region">MO</span>
  <span class="Postal-Code">12345</span><br />
  <span class="Country">USA</span><br />
</address>
<div class="note">A personal signature here</div>
</div>
</nowiki></pre>
This would display as:<br />
[mailto:john.smith@example.com John Smith]<br />
314-123-4567<br />
314-123-4568<br />
314-123-4569<br />
<br />
I work for [http://www.example.com/ Example Oragnization] in the Marketing and Communications department as Director, Marketing & Web Services<br />
<br />
123 Main Street<br />
Any Town, MO 12345<br />
USA<br />
<br />
A personal signature here<br />
<br />
== Baron von Münchhausen ==
<pre><nowiki>
BEGIN:VCARD
VERSION:2.0
N:Hieronymus;Karl;Friedrich;;Baron von Münchhausen;
FN:Karl Friedrich Hieronymus
NICKNAME:Baron von Münchhausen,The Baron of Lies,Freddy
SORT-STRING:Hieronymus
END:VCARD
</nowiki></pre>
This is one way to encode the vCard in HTML
<pre><nowiki>
<div class="vcard" xml:lang="de">
<span class="n">
  <span class="fn">
    <span class="Given-Name">Karl</span>
    <span class="Additional-Name">Friedrich</span>
    <span class="Family-Name sort-string">Hieronymus</span>,
  </span>
  <span class="Honorific-Suffixes">Baron von Münchhausen</span>
</span>
<h2>Nicknames</h2>
<ul class="nicknames">
  <li>Baron von Münchhausen</li>
  <li>The Baron of Lies</li>
  <li>Freddy</li>
</ul>
</div>
</nowiki></pre>
This would display as:<br />
Karl Friedrich Hieronymus, Baron von Münchhausen<br />
<br />
Nicknames
* Baron von Münchhausen
* The Baron of Lies
* Freddy
== Examples from the RFC ==
These examples were taken from the vCard RFC 2426.
<pre><nowiki>
N:Public;John;Quinlan;Mr.;Esq.
NICKNAME:Jim,Jimmie
PHOTO;VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif
LOGO;VALUE=uri:http://www.abc.com/pub/logos/abccorp.jpg
BDAY:1987-09-27T08:30:00-06:00
TEL;TYPE=work,voice,pref,msg:+1-213-555-1234
EMAIL;TYPE=internet:jqpublic@xyz.dom1.com\
TZ:-05:00
CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY
NOTE:This fax number is operational 0800 to 1715 EST\, Mon-Fri.
UID:s19950401-080045-40000F192713-0052
URL:http://www.swbyps.restaurant.french/~chezchic.html
<div class="vcard" id="s19950401-080045-40000F192713-0052">
<a href="mailto:jqpublic@xyz.dom1.com" class="email n">
  <span class="Prefix">Mr.</span> <span class="Given-Name">John</span>
  <span class="Additional-Names">Quinlan</span> <span class="Family-Name">Public</span>
  <span class="Honorific Suffixes">Esq.</span>
</a>
<ul class="nickname">
  <li>Jim</li>
  <li>Jimmie</li>
</ul>
<img src="http://www.abc.com/pub/photos/jqpublic.gif" class="photo" />
<img src="http://www.abc.com/pub/logos/abccorp.jpg" class="logo" />
<abbr title="1987-09-27T08:30:00-06:00" class="bday">Sept. 27th 1987</abbr>
<!-- Need to encode: TYPE=work,voice,pref,msg -->
<div class="tel">+1-213-555-1234</div>
<!-- I'm not sure this is accepted? -->
<abbr title="-05:00" class="TZ">Eastern Standard Time</abbr>
<ul class="categories">
  <li>INTERNET</li>
  <li>IETF</li>
  <li>INDUSTRY</li>
  <li>INFORMATION TECHNOLOGY</li>
</ul>
<div class="note">This fax number is operational 0800 to 1715 EST\, Mon-Fri.</div>
<a href="http://www.swbyps.restaurant.french/~chezchic.html" class="url"></a>
</div>
</nowiki></pre>
<pre><nowiki>
BEGIN:vCard
VERSION:3.0
FN:Frank Dawson
ORG:Lotus Development Corporation
ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive;Raleigh;NC;27613-3502;U.S.A.
TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
TEL;TYPE=FAX,WORK:+1-919-676-9564
EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
EMAIL;TYPE=INTERNET:fdawson@earthlink.net
URL:http://home.earthlink.net/~fdawson
END:vCard
<div class="vcard">
<a href="http://home.earthlink.net/~fdawson" class="url fn">Frank Dawson</a>
<div class="org">Lotus Development Corporation</div>
<!-- Need to encode WORK,POSTAL,PARCEL -->
<div class="adr">
  <span class="Street-Address">6544 Battleford Drive</span>
  <span class="Locality">Raleigh</span>
  <span class="Region">NC</span>
  <span class="Postal-Code">27613-3502</span>
  <span class="Country">U.S.A.</span>
</div>
<!-- need to encode VOICE,MSG,WORK FAX -->
<div class="tel">+1-919-676-9515</div>
<div class="tel">+1-919-676-9564</div>
<!-- Need to encode PREF -->
<a class="email" href="mailto:Frank_Dawson@Lotus.com">Frank_Dawson@Lotus.com</a>
<a class="email" href="mailto:fdawson@earthlink.net">fdawson@earthlink.net</a>
</div>
BEGIN:vCard
VERSION:3.0
FN:Tim Howes
ORG:Netscape Communications Corp.
ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View;CA; 94043;U.S.A.
TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419
TEL;TYPE=FAX,WORK:+1-415-528-4164
EMAIL;TYPE=INTERNET:howes@netscape.com
END:vCard
<div class="vcard">
<a href="mailto:howes@netscape.com" class="fn email">Tim Howes</a>
<div class="org">Netscape Communications Corp.</div>
<!-- Need to encode WORK -->
<div class="adr">
  <span class="Street-Address">501 E. Middlefield Rd</span>
  <span class="Locality">Mountain View</span>
  <span class="Region">CA</span>
  <span class="Postal-Code">94043</span>
  <span class="Country">U.S.A.</span>
</div>
<!-- need to encode VOICE,MSG,WORK FAX -->
<div class="tel">+1-415-937-3419</div>
<div class="tel">+1-415-528-4164</div>
</div>
</nowiki></pre>
= Short-cuts =
Here we can list some ideas to condense or create short-cuts in the design/markup.
== URL Property ==
The use of class="url" on an <a> tag to represent an hCard URL property is redundant. By virtue of the <a> tag you know this is a URL.
This does reduce redunancy and keeps things cleaner, but also creates a few proplems. Without explicitly noting that this is a URL then any <a> tags within a 'vcard' would be considered a URL, for example:
<pre><nowiki>
<span class="vcard">
...
<ul class="categories">
<li><a href="http://w3c.org">W3C</a></li>
</ul>
...
</span>
</nowiki></pre>
There is no way to "turn-off" the encoding of the W3C URL, whereas if "url" needed to be explicitly listed in the class attribute list, then by NOT listing it you could effectively turn it off.
= CSS Styles =
Not only can you create semantics with the hCard values, but you can add CSS styles to them as well. You are free to style the terms in any way you want, but here we can list a few ideas for how to style terms.
If you want to encode hCard data, but do NOT want to display it in the HTML code, then you can hide that tag in CSS with the following code:
<pre><nowiki>
<span style="display: none">Hidden Data</span>
</nowiki></pre>
Transforming applications will still find the data and use it when converting hCards to vCards.
= Auto-Discovery =
There is currently a debate over the best way to add an auto discovery link to your HTML to extract the vCard.
On the page with the hCard encoding, the best link would be as follows:
<code><nowiki> <link rel="alternate" type="text/vcard" href="..." /> </nowiki></code>
this HTML page is an alternate view of the vCard.
When on a different page, referencing that encoded page in the href would NOT be an alternate view of the current page. So a different rel type must be established to decribe that relationship. The ideas vary from specific to vague. The list and categories follow:
<pre><nowiki>
rel="contactinfo"
rel="profile"
rel="author"
rel='PIM'
rel='person'
rel='about'
rel='contact'
rel='hcard'
rel='microformat'
</nowiki></pre>
Example of mixing two rel types to a single page.
rel="hcard xfn"
NOTE: this one is probably ruled out because you could assume you are linking directly to a vCard, which is not true.
rel="vcard"
== Auto-Discovery for XFN ==
An author will typically their XFN information on a specific page, rather than all pages.  In particular, a specific page separate from the home page of their blog, and thus it would be useful to have an explicit rel value to assist in auto-discovery of XFN information.
This was suggested by Jens Alfke on 20050606 at the WWDC blogger's dinner.
= Open Questions =
Q: since many of the components would be using CSS classes for encoding data, it is possible to MIX two different profiles. (e.g. hCard and XFN) There are no real constraints on where/how to enforce class names, these are based on the html profile, since it is difficult to associate the text within the attribute to a specific profile. The W3C recommends that they are referenced in the order that the profiles are listed on the head tag.
<pre><nowiki>
...
<a href="mailto:joe.smith@example.com" class="fn" rel="met">Joe Smith</a>
...
</nowiki></pre>
-- [http://suda.co.uk/ Brian Suda]
Q: Preserving White space? Should the transforming applications preserve extra white space characters? For example:
<pre><nowiki>
<a href="http://mywebsite.com/" class="fn n">
    <span class="Given-Name">John</span>
    <span class="Other-Name">Q.</span>
    <span class="Family-Name">Public</span>
</a>
</nowiki></pre>
When transformed into a vCard, the N property will pick apart the span tags and create the value for N correctly seperated by colons. The FN property will take a string and simply display it. There are two possible renderings for FN:
<pre><nowiki>
John Q. Public
    John
    Q.
    Public
</nowiki></pre>
Either the white-space is preserved or it is not. Which should the transforming applications render?
-- [http://suda.co.uk/ Brian Suda]
Many of the Questions and Answers are relevant to both ["hCal"] and hCard.
Q: Would it be appropriate to wrap the name of the vCard owner with <dfn/>? This may give the hCard some added semantic value in the XHTML document.
<pre><nowiki>
<span class="agent">
<span class="vcard">
  <span class="email">
  <a class="internet" href="mailto:jfriday@host.com">
    <dfn>
      <span class="fn">Joe Friday</span>
    </dfn>
  </a>
  </span>
  <span class="tel">+1-919-555-7878</span>
  <span class="title">Area Administrator, Assistant</span>
</span>
</span>
</nowiki></pre>
-- [http://www.ben-ward.co.uk/ Ben Ward]
= Applications =
Applications that are hCard aware or can convert hCard to vCard formats.
* I think a Favlet would work nicely here. When you find a page that is hCard friendly, you click the favlet and you get yourself a vCard.
= Tutorials =
How to hCard encode entries in Popular blog software.
= @@ TODO =
A HTML head profile needs creation and a home.
= References =
== Normative References ==
* [http://www.ietf.org/rfc/rfc2426.txt RFC 2426] vCard RFC
* [http://www.ietf.org/rfc/rfc2397 RFC 2397] data URI RFC
* [http://gmpg.org/xmdp/ XMDP]
== Informative References ==
* [http://www.imc.org/pdi/ Personal Data Interchange (PDI) at the Internet Mail Consortium]
* [http://tantek.com/log/2004/07.html#d27t1049 Markup language design notes]
* [http://tantek.com/log/2002/12.html#L20021216t2238 A Touch of Class]
== Other Implementations/Ideas ==
* [http://www.w3.org/TR/2001/NOTE-vcard-rdf-20010222/ Representing vCard Objects in RDF/XML] This could allow conversion of vCard data from XHTML to RDF and from RDF to XHTML
* It would also be possible to convert XFN and hCard to FoaF and back.

Revision as of 05:00, 19 June 2005

hCardBrainstorming

Authors

Examples

  • We should provide 1:1 hCard examples for each example in RFC 2426.

2.4.2 VCARD

AGENT:BEGIN:VCARD\nFN:Joe Friday\nTEL:+1-919-555-7878\n
TITLE:Area Administrator\, Assistant\n EMAIL\;TYPE=INTERNET:\n
jfriday@host.com\nEND:VCARD\n

in hCard could be (hmm.. is AGENT something that needs special casing since it can occur *outside* of a VCARD?):

<span class="agent">
 <span class="vcard">
  <span class="email">
   <a class="internet" href="mailto:jfriday@host.com">
    <span class="fn">Joe Friday</span>
   </a>
  </span>
  <span class="tel">+1-919-555-7878</span>
  <span class="title">Area Administrator, Assistant</span>
 </span>
</span>

The outer agent & vcard spans could be easily collapsed however, and internet and fn could also be collapsed to use a single element as such:

<span class="agent vcard">
 <span class="email"
  <a class="internet fn" href="mailto:jfriday@host.com">Joe Friday</a>
 </span>
 <span class="tel">+1-919-555-7878</span>
 <span class="title">Area Administrator, Assistant</span>
</span>

this hCard could be displayed as:

Joe Friday +1-919-555-7878 Area Administrator, Assistant

3.1.1 FN Type Definition

FN:Mr. John Q. Public\, Esq.

this vCard fragment in a complete hCard would be:

<span class="vcard">
 <span class="fn">Mr. John Q. Public, Esq.</span>
<span>


John Smith

BEGIN:VCARD
VERSION:2.0
N:Smith;John
FN:John Smith
TEL;CELL:314-123-4567
TEL;FAX:314-123-4568
TEL;WORK:314-123-4569
URL:www.example.com
org:Example Oragnization;Marketing and Communications
EMAIL;INTERNET:john.smith@example.com
TITLE:Director, Marketing & Web Services
ADR;;123 Main Street;Any Town;MO;12345;USA
NOTE;quoted-printable:"A personal signature here"
END:VCARD

This is one way to encode the vCard in HTML

<div class="vcard">
  <a href="mailto:john.smith@example.com">
   <span class="fn n">
    <span class="Given-Name">John</span>
    <span class="Family-Name">Smith</span>
   </span>
  </a><br />

  <!-- need to encode CELL, FAX, WORK -->
  <span class="tel">314-123-4567</span><br />
  <span class="tel">314-123-4568</span><br />
  <span class="tel">314-123-4569</span><br />

<p>I work for
 <span class="org">
   <a href="http://www.example.com" class="Organizational-Name">Example Oragnization</a>
   in the <span class="Organizational-Unit">Marketing and Communications</span>
 </span>
 department as <span class="title">Director, Marketing & Web Services</span>
</p>

<address>
  <span class="Street">123 Main Street</span><br />
  <span class="Locality">Any Town</span>,
  <span class="Region">MO</span>
  <span class="Postal-Code">12345</span><br />
  <span class="Country">USA</span><br />
</address>

<div class="note">A personal signature here</div>

</div>

This would display as:
John Smith
314-123-4567
314-123-4568
314-123-4569

I work for Example Oragnization in the Marketing and Communications department as Director, Marketing & Web Services

123 Main Street
Any Town, MO 12345
USA

A personal signature here

Baron von Münchhausen

BEGIN:VCARD
VERSION:2.0
N:Hieronymus;Karl;Friedrich;;Baron von Münchhausen;
FN:Karl Friedrich Hieronymus
NICKNAME:Baron von Münchhausen,The Baron of Lies,Freddy
SORT-STRING:Hieronymus
END:VCARD

This is one way to encode the vCard in HTML

<div class="vcard" xml:lang="de">
 <span class="n">
   <span class="fn">
    <span class="Given-Name">Karl</span>
    <span class="Additional-Name">Friedrich</span>
    <span class="Family-Name sort-string">Hieronymus</span>, 
   </span>
   <span class="Honorific-Suffixes">Baron von Münchhausen</span>
 </span>
 <h2>Nicknames</h2>
 <ul class="nicknames">
   <li>Baron von Münchhausen</li>
   <li>The Baron of Lies</li>
   <li>Freddy</li>
 </ul>
</div>

This would display as:
Karl Friedrich Hieronymus, Baron von Münchhausen

Nicknames

* Baron von Münchhausen
* The Baron of Lies
* Freddy


Examples from the RFC

These examples were taken from the vCard RFC 2426.

N:Public;John;Quinlan;Mr.;Esq.
NICKNAME:Jim,Jimmie
PHOTO;VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif
LOGO;VALUE=uri:http://www.abc.com/pub/logos/abccorp.jpg
BDAY:1987-09-27T08:30:00-06:00
TEL;TYPE=work,voice,pref,msg:+1-213-555-1234
EMAIL;TYPE=internet:jqpublic@xyz.dom1.com\
TZ:-05:00
CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY
NOTE:This fax number is operational 0800 to 1715 EST\, Mon-Fri.
UID:s19950401-080045-40000F192713-0052
URL:http://www.swbyps.restaurant.french/~chezchic.html


<div class="vcard" id="s19950401-080045-40000F192713-0052">
<a href="mailto:jqpublic@xyz.dom1.com" class="email n">
  <span class="Prefix">Mr.</span> <span class="Given-Name">John</span> 
  <span class="Additional-Names">Quinlan</span> <span class="Family-Name">Public</span> 
  <span class="Honorific Suffixes">Esq.</span>
</a>
<ul class="nickname">
  <li>Jim</li>
  <li>Jimmie</li>
</ul>
<img src="http://www.abc.com/pub/photos/jqpublic.gif" class="photo" />
<img src="http://www.abc.com/pub/logos/abccorp.jpg" class="logo" />

<abbr title="1987-09-27T08:30:00-06:00" class="bday">Sept. 27th 1987</abbr>

<!-- Need to encode: TYPE=work,voice,pref,msg -->
<div class="tel">+1-213-555-1234</div>

<!-- I'm not sure this is accepted? -->
<abbr title="-05:00" class="TZ">Eastern Standard Time</abbr>

<ul class="categories">
  <li>INTERNET</li>
  <li>IETF</li>
  <li>INDUSTRY</li>
  <li>INFORMATION TECHNOLOGY</li>
</ul>

<div class="note">This fax number is operational 0800 to 1715 EST\, Mon-Fri.</div>
<a href="http://www.swbyps.restaurant.french/~chezchic.html" class="url"></a>
</div>


BEGIN:vCard
VERSION:3.0
FN:Frank Dawson
ORG:Lotus Development Corporation
ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive;Raleigh;NC;27613-3502;U.S.A.
TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515
TEL;TYPE=FAX,WORK:+1-919-676-9564
EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com
EMAIL;TYPE=INTERNET:fdawson@earthlink.net
URL:http://home.earthlink.net/~fdawson
END:vCard

<div class="vcard">
<a href="http://home.earthlink.net/~fdawson" class="url fn">Frank Dawson</a>
<div class="org">Lotus Development Corporation</div>

<!-- Need to encode WORK,POSTAL,PARCEL -->
<div class="adr">
  <span class="Street-Address">6544 Battleford Drive</span>
  <span class="Locality">Raleigh</span>
  <span class="Region">NC</span>
  <span class="Postal-Code">27613-3502</span>
  <span class="Country">U.S.A.</span>
</div>

<!-- need to encode VOICE,MSG,WORK FAX -->
<div class="tel">+1-919-676-9515</div>
<div class="tel">+1-919-676-9564</div>

<!-- Need to encode PREF -->
<a class="email" href="mailto:Frank_Dawson@Lotus.com">Frank_Dawson@Lotus.com</a>
<a class="email" href="mailto:fdawson@earthlink.net">fdawson@earthlink.net</a>
</div>


BEGIN:vCard
VERSION:3.0
FN:Tim Howes
ORG:Netscape Communications Corp.
ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View;CA; 94043;U.S.A.
TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419
TEL;TYPE=FAX,WORK:+1-415-528-4164
EMAIL;TYPE=INTERNET:howes@netscape.com
END:vCard

<div class="vcard">
<a href="mailto:howes@netscape.com" class="fn email">Tim Howes</a>
<div class="org">Netscape Communications Corp.</div>

<!-- Need to encode WORK -->
<div class="adr">
  <span class="Street-Address">501 E. Middlefield Rd</span>
  <span class="Locality">Mountain View</span>
  <span class="Region">CA</span>
  <span class="Postal-Code">94043</span>
  <span class="Country">U.S.A.</span>
</div>

<!-- need to encode VOICE,MSG,WORK FAX -->
<div class="tel">+1-415-937-3419</div>
<div class="tel">+1-415-528-4164</div>

</div>



Short-cuts

Here we can list some ideas to condense or create short-cuts in the design/markup.

URL Property

The use of class="url" on an <a> tag to represent an hCard URL property is redundant. By virtue of the <a> tag you know this is a URL.

This does reduce redunancy and keeps things cleaner, but also creates a few proplems. Without explicitly noting that this is a URL then any <a> tags within a 'vcard' would be considered a URL, for example:

<span class="vcard">
...
<ul class="categories">
<li><a href="http://w3c.org">W3C</a></li>
</ul>
...
</span>

There is no way to "turn-off" the encoding of the W3C URL, whereas if "url" needed to be explicitly listed in the class attribute list, then by NOT listing it you could effectively turn it off.

CSS Styles

Not only can you create semantics with the hCard values, but you can add CSS styles to them as well. You are free to style the terms in any way you want, but here we can list a few ideas for how to style terms.

If you want to encode hCard data, but do NOT want to display it in the HTML code, then you can hide that tag in CSS with the following code:

<span style="display: none">Hidden Data</span>

Transforming applications will still find the data and use it when converting hCards to vCards.

Auto-Discovery

There is currently a debate over the best way to add an auto discovery link to your HTML to extract the vCard.

On the page with the hCard encoding, the best link would be as follows: <link rel="alternate" type="text/vcard" href="..." /> this HTML page is an alternate view of the vCard.

When on a different page, referencing that encoded page in the href would NOT be an alternate view of the current page. So a different rel type must be established to decribe that relationship. The ideas vary from specific to vague. The list and categories follow:

rel="contactinfo"
rel="profile"
rel="author"
rel='PIM'
rel='person'
rel='about'
rel='contact'
rel='hcard'
rel='microformat'

Example of mixing two rel types to a single page. rel="hcard xfn"

NOTE: this one is probably ruled out because you could assume you are linking directly to a vCard, which is not true. rel="vcard"

Auto-Discovery for XFN

An author will typically their XFN information on a specific page, rather than all pages. In particular, a specific page separate from the home page of their blog, and thus it would be useful to have an explicit rel value to assist in auto-discovery of XFN information.

This was suggested by Jens Alfke on 20050606 at the WWDC blogger's dinner.


Open Questions

Q: since many of the components would be using CSS classes for encoding data, it is possible to MIX two different profiles. (e.g. hCard and XFN) There are no real constraints on where/how to enforce class names, these are based on the html profile, since it is difficult to associate the text within the attribute to a specific profile. The W3C recommends that they are referenced in the order that the profiles are listed on the head tag.

...
<a href="mailto:joe.smith@example.com" class="fn" rel="met">Joe Smith</a>
...

-- Brian Suda

Q: Preserving White space? Should the transforming applications preserve extra white space characters? For example:

<a href="http://mywebsite.com/" class="fn n">
    <span class="Given-Name">John</span>
    <span class="Other-Name">Q.</span>
    <span class="Family-Name">Public</span>
</a>

When transformed into a vCard, the N property will pick apart the span tags and create the value for N correctly seperated by colons. The FN property will take a string and simply display it. There are two possible renderings for FN:

John Q. Public

    John
    Q.
    Public

Either the white-space is preserved or it is not. Which should the transforming applications render?

-- Brian Suda

Many of the Questions and Answers are relevant to both ["hCal"] and hCard.

Q: Would it be appropriate to wrap the name of the vCard owner with ? This may give the hCard some added semantic value in the XHTML document.

<span class="agent"> 
 <span class="vcard">
  <span class="email">
   <a class="internet" href="mailto:jfriday@host.com">
    <dfn>
       <span class="fn">Joe Friday</span>
    </dfn>
   </a>
  </span>
  <span class="tel">+1-919-555-7878</span>
  <span class="title">Area Administrator, Assistant</span>
 </span>
</span>

-- Ben Ward

Applications

Applications that are hCard aware or can convert hCard to vCard formats.

  • I think a Favlet would work nicely here. When you find a page that is hCard friendly, you click the favlet and you get yourself a vCard.

Tutorials

How to hCard encode entries in Popular blog software.

@@ TODO

A HTML head profile needs creation and a home.

References

Normative References

Informative References

Other Implementations/Ideas

  • Representing vCard Objects in RDF/XML This could allow conversion of vCard data from XHTML to RDF and from RDF to XHTML
  • It would also be possible to convert XFN and hCard to FoaF and back.