hcard-examples-rfc2426: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
mNo edit summary
 
m (Reverted edits by ABIDEEN10 (Talk) to last version by Tantek)
 
(108 intermediate revisions by 22 users not shown)
Line 1: Line 1:
= hCard examples =
:'''This is a sub-page of [[hcard-examples]]'''


Example [[hcard|hCards]].
== <nowiki>RFC 2426</nowiki> examples in hCard ==


== Authors ==
These are 1:1 hCard examples for each example in [[rfc-2426|RFC2426]].
* [http://tantek.com/log Tantek Çelik]
* Brian Suda


== RFC 2426 examples in hCard ==
Mark Pilgrim has made these hCard examples available as separate files:
 
* http://diveintomark.org/projects/greasemonkey/hcard/tests/
* In the process of creating 1:1 hCard examples for each example in [http://www.ietf.org/rfc/rfc2426.txt RFC 2426].


=== 2.4.2 VCARD ===
=== 2.4.2 VCARD ===
Line 19: Line 16:
</nowiki></pre>
</nowiki></pre>


in hCard could literally be (with the unnecessary type=internet default omitted):
This vCard fragment has one property whose value is another vCard, and could be represented as an hCard fragment with an embedded hCard, literally (with the unnecessary type=internet default omitted, and the implied n optimization):
 
<pre><nowiki>
<div class="agent">
<div class="vcard">
  <a class="email" href="mailto:jfriday@host.com">
  <span class="fn">Joe Friday</span>
  </a>
  <div class="tel">+1-919-555-7878</div>
  <div class="title">Area Administrator, Assistant</div>
</div>
</div>
</nowiki></pre>
 
The outer agent & vcard spans can be easily collapsed, and email and fn can also be collapsed to use a single element as such:
 
'''ISSUE''': Should we bother with showing simplification steps for the RFC 2426 examples in hCard?  Or just show the simplified end result?  And optionally show the derivation(s) on a separate page?


<pre><nowiki>
<pre><nowiki>
Line 47: Line 28:
this hCard could be displayed as:
this hCard could be displayed as:


[mailto:jfriday@host.com Joe Friday]
[mailto:jfriday@host.com Joe Friday]<br />
+1-919-555-7878
+1-919-555-7878<br />
Area Administrator, Assistant
Area Administrator, Assistant


Line 63: Line 44:
</nowiki></pre>
</nowiki></pre>


this hCard fragment could be displayed as:
Mr. John Q. Public, Esq.
=== 3.1.2 N Type Definition ===
==== N Example 1 ====
<pre><nowiki>
N:Public;John;Quinlan;Mr.;Esq.
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="n">
<span class="honorific-prefix">Mr.</span>
<span class="given-name">John</span>
<span class="additional-name">Quinlan</span>
<span class="family-name">Public</span>,
<span class="honorific-suffix">Esq.</span>
</span>
</nowiki></pre>
this hCard fragment could be displayed as:
Mr. John Quinlan Public, Esq.
==== N Example 2 ====
<pre><nowiki>
N:Stevenson;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P.
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="n">
<span class="honorific-prefix">Dr.</span>
<span class="given-name">John</span>
<span class="additional-name">Philip</span>
<span class="additional-name">Paul</span>
<span class="family-name">Stevenson</span>,
<span class="honorific-suffix">Jr.</span>,
<span class="honorific-suffix">M.D.</span>,
<span class="honorific-suffix">A.C.P.</span>
</span>
</nowiki></pre>
this hCard fragment would be displayed as:
Dr. John Philip Paul Stevenson, Jr., M.D., A.C.P.
=== 3.1.3 NICKNAME Type Definition ===
==== NICKNAME Example 1 ====
<pre><nowiki>
NICKNAME:Robbie
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="nickname">Robbie</span>
</nowiki></pre>
this hCard fragment could be displayed as:
Robbie
==== NICKNAME Example 2 ====
<pre><nowiki>
NICKNAME:Jim,Jimmie
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="nickname">Jim</span>,
<span class="nickname">Jimmie</span>
</nowiki></pre>
this hCard fragment would be displayed as:
Jim, Jimmie
=== 3.1.4 PHOTO Type Definition ===
==== PHOTO Example 1 ====
<pre><nowiki>
PHOTO;VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<img class="photo" src="http://www.abc.com/pub/photos/jqpublic.gif" alt="" />
</nowiki></pre>
==== PHOTO Example 2 ====
<pre><nowiki>
PHOTO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
<...remainder of "B" encoded binary data...>
</nowiki></pre>
this vCard fragment as an hCard fragment (line breaks inserted into src value for readability):
<pre><nowiki>
<img class="photo" src="data:image/jpeg;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
...remainder of B encoded binary data..." alt="" />
</nowiki></pre>
=== 3.1.5 BDAY Type Definition ===
==== BDAY Example 1 ====
<pre><nowiki>
BDAY:1996-04-15
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<abbr class="bday" title="1996-04-15">April 15, 1996</abbr>
</nowiki></pre>
this hCard fragment could be displayed as:
<abbr class="bday" title="1996-04-15">April 15, 1996</abbr>
==== BDAY Example 2 ====
<pre><nowiki>
BDAY:1953-10-15T23:10:00Z
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<abbr class="bday" title="1953-10-15T23:10:00Z">Oct 15, 1953</abbr>
</nowiki></pre>
this hCard fragment could be displayed as:
<abbr class="bday" title="1953-10-15T23:10:00Z">Oct 15, 1953</abbr>
==== BDAY Example 3 ====
<pre><nowiki>
BDAY:1987-09-27T08:30:00-06:00
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<abbr class="bday" title="1987-09-27T08:30:00-06:00">Sept 9, 1987</abbr>
</nowiki></pre>
this hCard fragment could be displayed as:
<abbr class="bday" title="1987-09-27T08:30:00-06:00">Sept 9, 1987</abbr>
=== 3.2.1 ADR Type Definition ===
<pre><nowiki>
ADR;TYPE=dom,home,postal,parcel:;;123 Main
  Street;Any Town;CA;91921-1234
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<div class="adr">
<abbr class="type" title="dom">US</abbr>
<span class="type">home</span> address, for
<abbr class="type" title="postal">mail</abbr> and
<abbr class="type" title="parcel">shipments</abbr>:
<div class="street-address">123 Main Street</div>
<span class="locality">Any Town</span>, <span class="region">CA</span>,
<span class="postal-code">91921-1234</span>
</div>
</nowiki></pre>
this hCard fragment could be displayed as:
<div class="adr">
<abbr class="type" title="dom">US</abbr>
<span class="type">home</span> address, for
<abbr class="type" title="postal">mail</abbr> and
<abbr class="type" title="parcel">shipments</abbr>:
<div class="street-address">123 Main Street</div>
<span class="locality">Any Town</span>, <span class="region">CA</span>,
<span class="postal-code">91921-1234</span>
</div>
=== 3.2.2 LABEL Type Definition ===
<pre><nowiki>
LABEL;TYPE=dom,home,postal,parcel:Mr.John Q. Public\, Esq.\n
Mail Drop: TNE QB\n123 Main Street\nAny Town\, CA  91921-1234
\nU.S.A.
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
Please use the following address label for
<div class="label">
<abbr class="type" title="dom">local delivery</abbr>
<abbr class="type" title="home">to my home</abbr>
<abbr class="type" title="postal">of mail</abbr>
<abbr class="type" title="parcel">and packages:</abbr>
<pre>
Mr.John Q. Public, Esq.
Mail Drop: TNE QB
123 Main Street
Any Town, CA  91921-1234
U.S.A.
</pre>
</div>
</nowiki></pre>
'''Note:''' the above hCard fragment uses a &lt;pre&gt; tag inside a property value to capture/represent explicit carriage returns ("\n" characters) from the vCard fragment.
this hCard fragment could be displayed as:
Please use the following address label for
<abbr class="type" title="dom">local delivery</abbr>
<abbr class="type" title="home">to my home</abbr>
<abbr class="type" title="postal">of mail</abbr>
<abbr class="type" title="parcel">and packages:</abbr>
<pre>
Mr.John Q. Public, Esq.
Mail Drop: TNE QB
123 Main Street
Any Town, CA  91921-1234
U.S.A.
</pre>
=== 3.3.1 TEL Type Definition ===
<pre><nowiki>
TEL;TYPE=work,voice,pref,msg:+1-213-555-1234
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="tel">
<abbr class="type" title="pref">my</abbr>
<span class="type">work</span>
<abbr class="type" title="voice">phone</abbr>, with
<abbr class="type" title="msg">voicemail</abbr>:
<span class="value">+1-213-555-1234</span>
</span>
</nowiki></pre>
this hCard fragment could be displayed as:
my work phone, with voicemail: +1-213-555-1234
=== 3.3.2 EMAIL Type Definition ===
==== EMAIL Example 1 ====
<pre><nowiki>
EMAIL;TYPE=internet:jqpublic@xyz.dom1.com
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<a class="email" href="mailto:jqpublic@xyz.dom1.com">email jqpublic</a>
</nowiki></pre>
this hCard fragment could be displayed as:
[mailto:jqpublic@xyz.dom1.com email jqpublic]
==== EMAIL Example 2 ====
<pre><nowiki>
EMAIL;TYPE=internet:jdoe@isp.net
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<a class="email" href="mailto:jdoe@isp.net">email jdoe</a>
</nowiki></pre>
this hCard fragment could be displayed as:
[mailto:jdoe@isp.net email jdoe]
==== EMAIL Example 3 ====
<pre><nowiki>
EMAIL;TYPE=internet,pref:jane_doe@abc.com
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<a class="email" href="mailto:jane_doe@abc.com">
<abbr class="type" title="pref">preferred</abbr>
email for jane_doe
</a>
</nowiki></pre>
this hCard fragment could be displayed as:
[mailto:jane_doe@abc.com preferred email for jane_doe]
=== 3.3.3 MAILER Type Definition ===
<pre><nowiki>
MAILER:PigeonMail 2.1
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
Jane Doe uses <span class="mailer">PigeonMail 2.1</span> for email.
</nowiki></pre>
this hCard fragment could be displayed as:
Jane Doe uses <span class="mailer">PigeonMail 2.1</span> for email.
=== 3.4.1 TZ Type Definition ===
==== TZ Example 1 ====
<pre><nowiki>
TZ:-05:00
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="tz">-05:00</span>
</nowiki></pre>
this hCard fragment could be displayed as:
-05:00
==== TZ Example 2 ====
<pre><nowiki>
TZ;VALUE=text:-05:00; EST; Raleigh/North America
;This example has a single value, not a structure text value.
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<abbr class="tz"
title="-05:00; EST; Raleigh/North America;This example has a single value, not a structure text value.">
EST
</abbr>
</nowiki></pre>
this hCard fragment could be displayed as:
<abbr class="tz" title="-05:00; EST; Raleigh/North America;This example has a single value, not a structure text value.">EST</abbr>
=== 3.4.2 GEO Type Definition ===
<pre><nowiki>
GEO:37.386013;-122.082932
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="geo">
<span class="latitude">37.386013</span>,
<span class="longitude">-122.082932</span>
</span>
</nowiki></pre>
this hCard fragment could be displayed as:
37.386013, -122.082932
=== 3.5.1 TITLE Type Definition ===
<pre><nowiki>
TITLE:Director\, Research and Development
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="title">Director, Research and Development</span>
</nowiki></pre>
this hCard fragment could be displayed as:
Director, Research and Development
=== 3.5.2 ROLE Type Definition ===
<pre><nowiki>
ROLE:Programmer
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="role">Programmer</span>
</nowiki></pre>
this hCard fragment could be displayed as:
Programmer
=== 3.5.3 LOGO Type Definition ===
==== LOGO Example 1 ====
<pre><nowiki>
LOGO;VALUE=uri:http://www.abc.com/pub/logos/abccorp.jpg
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<img class="logo" src="http://www.abc.com/pub/logos/abccorp.jpg" alt="my logo" />
</nowiki></pre>
this hCard fragment could be displayed as (note: I used a real URL for the image):
http://microformats.org/img/mf-lg-ora.gif
==== LOGO Example 2 ====
<pre><nowiki>
LOGO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
<...the remainder of "B" encoded binary data...>
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<img class="logo" src="data:image/jpeg;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
...remainder of B encoded binary data..." alt="" />
</nowiki></pre>
no display equivalent given, since data: URL from original example is incomplete.
=== 3.5.4 AGENT Type Definition ===
==== AGENT Example 1 ====
<pre><nowiki>
AGENT;VALUE=uri:
CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<a class="agent" href="CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com">JQPUBLIC</a>
</nowiki></pre>
this hCard fragment could be displayed as:
JQPUBLIC
==== AGENT Example 2 ====
<pre><nowiki>
AGENT:BEGIN:VCARD\nFN:Susan Thomas\nTEL:+1-919-555-
1234\nEMAIL\;INTERNET:sthomas@host.com\nEND:VCARD\n
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<span class="agent vcard">
<a class="email fn" href="mailto:sthomas@host.com">Susan Thomas</a>,
<span class="tel">+1-919-555-1234</span>
</span>
</nowiki></pre>
this hCard fragment could be displayed as:
[mailto:sthomas@host.com Susan Thomas], +1-919-555-1234
Note: the vCard in the AGENT property vCard fragment is actually invalid since it lacks an "N" property.  However, the hCard version *is* valid, since the implied N rule applies to the given "fn" property.
=== 3.5.5 ORG Type Definition ===
<pre><nowiki>
ORG:ABC\, Inc.;North American Division;Marketing
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="org">
<span class="organization-name">ABC, Inc.</span>,
<span class="organization-unit">North American Division</span>,
<span class="organization-unit">Marketing</span>,
</span>
</nowiki></pre>
this hCard fragment could be displayed as:
ABC, Inc., North American Division, Marketing
=== 3.6.1 CATEGORIES Type Definition ===
==== CATEGORIES Example 1 ====
<pre><nowiki>
CATEGORIES:TRAVEL AGENT
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="category">TRAVEL AGENT</span>
</nowiki></pre>
this hCard fragment could be displayed as:
TRAVEL AGENT
==== CATEGORIES Example 2 ====
<pre><nowiki>
CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="category">INTERNET</span>,
<span class="category">IETF</span>,
<span class="category">INDUSTRY</span>,
<span class="category">INFORMATION TECHNOLOGY</span>
</nowiki></pre>
this hCard fragment would be displayed as:
INTERNET, IETF, INDUSTRY, INFORMATION TECHNOLOGY
=== 3.6.2 NOTE Type Definition ===
<pre><nowiki>
NOTE:This fax number is operational 0800 to 1715
EST\, Mon-Fri.
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<p class="note">This fax number is operational 0800 to 1715 EST, Mon-Fri.</p>
</nowiki></pre>
this hCard fragment could be displayed as:
This fax number is operational 0800 to 1715 EST, Mon-Fri.
=== 3.6.3 PRODID Type Definition ===
<pre><nowiki>
PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN
</nowiki></pre>
Note, this vCard property actually doesn't make sense as a  hCard property, since it really should be filled in by whatever code transforms the hCard into a vCard, e.g. Brian Suda's X2V.
=== 3.6.4 REV Type Definition ===
==== REV Example 1 ====
<pre><nowiki>
REV:1995-10-31T22:27:10Z
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<abbr class="rev" title="1995-10-31T22:27:10Z">Updated: 10/31 10:27p</abbr>
</nowiki></pre>
this hCard fragment could be displayed as:
<abbr class="rev" title="1995-10-31T22:27:10Z">Updated: 10/31 10:27p</abbr>
==== REV Example 2 ====
<pre><nowiki>
REV:1997-11-15
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<abbr class="rev" title="1997-11-15">Updated: November 15</abbr>
</nowiki></pre>
this hCard fragment could be displayed as:
<abbr class="rev" title="1997-11-15">Updated: November 15</abbr>
=== 3.6.5 SORT-STRING Type Definition ===
==== SORT-STRING Example 1 ====
<pre><nowiki>
FN:Rene van der Harten
N:van der Harten;Rene;J.;Sir;R.D.O.N.
SORT-STRING:Harten
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="n">
<span class="honorific-prefix">Sir</span>
<span class="fn">
  <span class="given-name">Rene</span>
  <span class="family-name">
  van der <span class="sort-string">Harten</span>
  </span>
</span>
(<span class="additional-name">J.</span>),
<span class="honorific-suffix">R.D.O.N.</span>
</span>
</nowiki></pre>
Note: The string "Harten" was NOT repeated in the hCard, even though it WAS repeated in the vCard (3 times! In N, FN, and SORT-STRING).  The "SORT-STRING" property provides another good demonstration of how hCard enables better adherence to the [http://microformats.org/wiki/hcard-example1-steps#hCard_example_iteration_1:_DRY DRY principle] than vCard.
this hCard fragment could be displayed as:
Sir Rene van der Harten (J.), R.D.O.N.
==== SORT-STRING Example 2 ====
<pre><nowiki>
FN:Robert Pau Shou Chang
N:Pau;Shou Chang;Robert
SORT-STRING:Pau
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="fn n">
<span class="additional-name">Robert</span>
<span class="family-name sort-string">Pau</span>
<span class="given-name">Shou Chang</span>
</span>
</nowiki></pre>
Note: Not only was the string "Pau" was NOT repeated in the hCard (better [http://microformats.org/wiki/hcard-example1-steps#hCard_example_iteration_1:_DRY DRY principle] adherence again), even though it WAS repeated in the vCard, but in this case since the "family-name" and "sort-string" are the same, we were able to use [http://microformats.org/wiki/hcard-example1-steps#hCard_example_iteration_2:_element_conservation element conservation] and use only one element for both properties.
this hCard fragment could be displayed as:
Robert Pau Shou Chang
==== SORT-STRING Example 3 ====
<pre><nowiki>
FN:Osamu Koura
N:Koura;Osamu
SORT-STRING:Koura
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="fn">
Osamu <span class="sort-string">Koura</span>
</span>
</nowiki></pre>
Note: This example, in addition to illustrating better support for the [http://microformats.org/wiki/hcard-example1-steps#hCard_example_iteration_1:_DRY DRY principle], also makes use of the [http://microformats.org/wiki/hcard#Implied_.22N.22_Optimization Implied "N" Optimization].
this hCard fragment could be displayed as:
Osamu Koura
==== SORT-STRING Example 4 ====
<pre><nowiki>
FN:Oscar del Pozo
N:del Pozo Triscon;Oscar
SORT-STRING:Pozo
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="n">
<span class="fn">
  <span class="given-name">Oscar</span>
  del <span class="sort-string">Pozo</span>
</span>
<span class="family-name" style="display:none">
  del Pozo Triscon
</span>
</span>
</nowiki></pre>
Note: This example unfortunately could not completely adhere to the DRY principle due to the "FN" using a *substring* of the family-name, and in addition thus had to hide the extra "family-name" string value using CSS display:none, which in general should be avoided.  Suggestion welcome for improvements on this hCard fragement.
this hCard fragment could be displayed as:
Oscar del Pozo
==== SORT-STRING Example 5 ====
<pre><nowiki>
FN:Christine d'Aboville
N:d'Aboville;Christine
SORT-STRING:Aboville
</nowiki></pre>
this vCard fragment as an hCard fragment:
<pre><nowiki>
<span class="fn">
Christine d'<span class="sort-string">Aboville</span>
</span>
</nowiki></pre>
Note: This example re-demonstrates the same hCard advantages/efficiencies demonstrated in [http://microformats.org/wiki/hcard-examples#Example_3_3 example 3] above.
this hCard fragment could be displayed as:
Christine d'Aboville
=== 3.6.6 SOUND Type Definition ===
==== SOUND Example 1 ====
<pre><nowiki>
SOUND;TYPE=BASIC;VALUE=uri:CID:JOHNQPUBLIC.part8.
19960229T080000.xyzMail@host1.com
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<object class="sound" type="audio/basic"
data="CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@host1.com">
pronounciation of "JOHN Q PUBLIC"
</object>
</nowiki></pre>
this hCard fragment would probably be displayed as
pronounciation of "JOHN Q PUBLIC"
unless your browser supports the MIME type "audio/basic" (defined in [http://www.rfc-editor.org/rfc/rfc2046.txt RFC2046 section 4.3]) and has some way of retrieving "CID:" urls.
==== SOUND Example 2 ====
<pre><nowiki>
SOUND;TYPE=BASIC;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
<...the remainder of "B" encoded binary data...>
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<object class="sound"
data="data:audio/basic;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
...the remainder of "B" encoded binary data...">
pronounciation
</object>
</nowiki></pre>
no display equivalent given, since data: URL from original example is incomplete.
=== 3.6.7 UID Type Definition ===
<pre><nowiki>
UID:19950401-080045-40000F192713-0052
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
Unique id:
<span class="uid">19950401-080045-40000F192713-0052</span>
</nowiki></pre>
this hCard fragment could be displayed as
Unique id:19950401-080045-40000F192713-0052
Note: in practice I don't think I've seen globally unique IDs for "contact info" records published on the web, but perhaps I am not considering enough examples.
=== 3.6.8 URL Type Definition ===
<pre><nowiki>
URL:http://www.swbyps.restaurant.french/~chezchic.html
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<a class="url" href="http://www.swbyps.restaurant.french/~chezchic.html">Chez Chic</a>
</nowiki></pre>
this hCard fragment could be displayed as
[http://www.swbyps.restaurant.french/~chezchic.html Chez Chic]
=== 3.7.1 CLASS Type Definition ===
==== CLASS Example 1 ====
<pre><nowiki>
CLASS:PUBLIC
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<span class="class">PUBLIC</span>
</nowiki></pre>
this hCard fragment could be displayed as
PUBLIC
==== CLASS Example 2 ====
<pre><nowiki>
CLASS:PRIVATE
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<span class="class">PRIVATE</span>
</nowiki></pre>
this hCard fragment could be displayed as
PRIVATE
==== CLASS Example 3 ====
<pre><nowiki>
CLASS:CONFIDENTIAL
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<span class="class">CONFIDENTIAL</span>
</nowiki></pre>
this hCard fragment could be displayed as
CONFIDENTIAL
=== 3.7.2 KEY Type Definition ===
<pre><nowiki>
KEY;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA
wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX
Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj
E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD
VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx
MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz
Y2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ
EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2
dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB
EGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau
+hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP
mx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//y
rZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7
UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ==
</nowiki></pre>
this vCard fragment as an hCard fragment
<pre><nowiki>
<object class="key" type="application/octet-stream"
data="data:application/octet-stream;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA
wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX
Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj
E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD
VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx
MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz
Y2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ
EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2
dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB
EGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau
+hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP
mx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//y
rZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7
UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ==">
Key
</object>
</nowiki></pre>
this hCard fragment could be displayed as
Key
Note: Because of the lack of a TYPE value in the RFC2426 example, I substituted application/octet-stream.  Clearly for it to be of some use, the type specified must be some sort of key or certificate mime type.
=== 7.  Authors' Addresses ===
<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
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
</nowiki></pre>
Note that both of these vCards are invalid since they lack the REQUIRED "N" property which is quite ironic, since these are the vCards of the authors themselves.
Nonetheless, these vCards can be represented by the following hCards:
<pre><nowiki>
<div class="vcard">
<a class="url fn" href="http://home.earthlink.net/~fdawson">Frank Dawson</a>
<div class="org">Lotus Development Corporation</div>
<div class="adr">
<span class="type">work</span> address
(<abbr class="type" title="postal">mail</abbr> and
<abbr class="type" title="parcel">packages</abbr>):
<div class="street-address">6544 Battleford Drive</div>
<span class="locality">Raleigh</span>
<span class="region">NC</span>
<span class="postal-code">27613-3502</span>
<div class="country-name">U.S.A.</div>
</div>
<div class="tel">
<span class="value">+1-919-676-9515</span>
(<abbr class="type" title="WORK">w</abbr>,
<abbr class="type" title="VOICE">v</abbr><abbr class="type" title="MSG">m</abbr>)
</div>
<div class="tel">
<span class="value">+1-919-676-9564</span>
(<abbr class="type" title="WORK">w</abbr><abbr class="type" title="FAX">f</abbr>)
</div>
<a class="email" href="mailto:Frank_Dawson@Lotus.com">
<span class="type">pref</span><span>erred email</span>
</a>,
<a class="email" href="mailto:fdawson@earthlink.net">
alternate email
</a>
</div>
<div class="vcard">
<a class="email fn" href="mailto:howes@netscape.com">Tim Howes</a>
<div class="org">Netscape Communications Corp.</div>
<div class="adr">
<span class="type">work</span> address:
<div class="street-address">501 E. Middlefield Rd.</div>
<span class="locality">Mountain View</span>,
<span class="region">CA</span>
<span class="postal-code">94043</span>
<div class="country-name">U.S.A.</div>
</div>
<div class="tel">
<span class="value">+1-415-937-3419</span>
(<abbr class="type" title="WORK">w</abbr>,
<abbr class="type" title="VOICE">v</abbr><abbr class="type" title="MSG">m</abbr>)
</div>
<div class="tel">
<span class="value">+1-415-528-4164</span>
(<abbr class="type" title="WORK">w</abbr><abbr class="type" title="FAX">f</abbr>)
</div>
</div>
</nowiki></pre>
this hCards could be displayed as
<div class="vcard">
<span class="fn">[http://home.earthlink.net/~fdawson Frank Dawson]</span>
<div class="org">Lotus Development Corporation</div>
<div class="adr">
<span class="type">work</span> address
(<abbr class="type" title="postal">mail</abbr> and
<abbr class="type" title="parcel">packages</abbr>):
<div class="street-address">6544 Battleford Drive</div>
<span class="locality">Raleigh</span>
<span class="region">NC</span>
<span class="postal-code">27613-3502</span>
<div class="country-name">U.S.A.</div>
</div>
<div class="tel">
<span class="value">+1-919-676-9515</span>
(<abbr class="type" title="WORK">w</abbr>,
<abbr class="type" title="VOICE">v</abbr><abbr class="type" title="MSG">m</abbr>)
</div>
<div class="tel">
<span class="value">+1-919-676-9564</span>
(<abbr class="type" title="WORK">w</abbr><abbr class="type" title="FAX">f</abbr>)
</div>
[mailto:Frank_Dawson@Lotus.com preferred email],
[mailto:fdawson@earthlink.net alternate email]
</div>
<div class="vcard">
<span class="fn">[mailto:howes@netscape.com Tim Howes]</span>
<div class="org">Netscape Communications Corp.</div>
<div class="adr">
<span class="type">work</span> address:
<div class="street-address">501 E. Middlefield Rd.</div>
<span class="locality">Mountain View</span>,
<span class="region">CA</span>
<span class="postal-code">94043</span>
<div class="country-name">U.S.A.</div>
</div>
<div class="tel">
<span class="value">+1-415-937-3419</span>
(<abbr class="type" title="WORK">w</abbr>,
<abbr class="type" title="VOICE">v</abbr><abbr class="type" title="MSG">m</abbr>)
</div>
<div class="tel">
<span class="value">+1-415-528-4164</span>
(<abbr class="type" title="WORK">w</abbr><abbr class="type" title="FAX">f</abbr>)
</div>
</div>


== Other ==


* See [[hcard-brainstorming]] for more examples (which may eventually be moved here) and analysis.
:'''This is a sub-page of [[hcard-examples]]'''

Latest revision as of 04:58, 7 April 2013

This is a sub-page of hcard-examples

RFC 2426 examples in hCard

These are 1:1 hCard examples for each example in RFC2426.

Mark Pilgrim has made these hCard examples available as separate files:

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

This vCard fragment has one property whose value is another vCard, and could be represented as an hCard fragment with an embedded hCard, literally (with the unnecessary type=internet default omitted, and the implied n optimization):

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

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 as an hCard fragment:

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

this hCard fragment could be displayed as:

Mr. John Q. Public, Esq.

3.1.2 N Type Definition

N Example 1

N:Public;John;Quinlan;Mr.;Esq.

this vCard fragment as an hCard fragment:

<span class="n">
 <span class="honorific-prefix">Mr.</span>
 <span class="given-name">John</span>
 <span class="additional-name">Quinlan</span>
 <span class="family-name">Public</span>, 
 <span class="honorific-suffix">Esq.</span>
</span>

this hCard fragment could be displayed as:

Mr. John Quinlan Public, Esq.

N Example 2

N:Stevenson;John;Philip,Paul;Dr.;Jr.,M.D.,A.C.P.

this vCard fragment as an hCard fragment:

<span class="n">
 <span class="honorific-prefix">Dr.</span>
 <span class="given-name">John</span>
 <span class="additional-name">Philip</span>
 <span class="additional-name">Paul</span>
 <span class="family-name">Stevenson</span>,
 <span class="honorific-suffix">Jr.</span>,
 <span class="honorific-suffix">M.D.</span>,
 <span class="honorific-suffix">A.C.P.</span>
</span>

this hCard fragment would be displayed as:

Dr. John Philip Paul Stevenson, Jr., M.D., A.C.P.

3.1.3 NICKNAME Type Definition

NICKNAME Example 1

NICKNAME:Robbie

this vCard fragment as an hCard fragment:

<span class="nickname">Robbie</span>

this hCard fragment could be displayed as:

Robbie

NICKNAME Example 2

NICKNAME:Jim,Jimmie

this vCard fragment as an hCard fragment:

<span class="nickname">Jim</span>, 
<span class="nickname">Jimmie</span>

this hCard fragment would be displayed as:

Jim, Jimmie

3.1.4 PHOTO Type Definition

PHOTO Example 1

PHOTO;VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif

this vCard fragment as an hCard fragment:

<img class="photo" src="http://www.abc.com/pub/photos/jqpublic.gif" alt="" />

PHOTO Example 2

PHOTO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
 AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
 ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
 <...remainder of "B" encoded binary data...>

this vCard fragment as an hCard fragment (line breaks inserted into src value for readability):

<img class="photo" src="data:image/jpeg;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
...remainder of B encoded binary data..." alt="" />

3.1.5 BDAY Type Definition

BDAY Example 1

BDAY:1996-04-15

this vCard fragment as an hCard fragment:

<abbr class="bday" title="1996-04-15">April 15, 1996</abbr>

this hCard fragment could be displayed as:

April 15, 1996

BDAY Example 2

BDAY:1953-10-15T23:10:00Z

this vCard fragment as an hCard fragment:

<abbr class="bday" title="1953-10-15T23:10:00Z">Oct 15, 1953</abbr>

this hCard fragment could be displayed as:

Oct 15, 1953

BDAY Example 3

BDAY:1987-09-27T08:30:00-06:00

this vCard fragment as an hCard fragment:

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

this hCard fragment could be displayed as:

Sept 9, 1987

3.2.1 ADR Type Definition

ADR;TYPE=dom,home,postal,parcel:;;123 Main
  Street;Any Town;CA;91921-1234

this vCard fragment as an hCard fragment:

<div class="adr">
 <abbr class="type" title="dom">US</abbr>
 <span class="type">home</span> address, for
 <abbr class="type" title="postal">mail</abbr> and
 <abbr class="type" title="parcel">shipments</abbr>:
 <div class="street-address">123 Main Street</div>
 <span class="locality">Any Town</span>, <span class="region">CA</span>, 
 <span class="postal-code">91921-1234</span>
</div>

this hCard fragment could be displayed as:

US home address, for mail and shipments:

123 Main Street

Any Town, CA, 91921-1234

3.2.2 LABEL Type Definition

LABEL;TYPE=dom,home,postal,parcel:Mr.John Q. Public\, Esq.\n
 Mail Drop: TNE QB\n123 Main Street\nAny Town\, CA  91921-1234
 \nU.S.A.

this vCard fragment as an hCard fragment:

<nowiki>
Please use the following address label for 
<div class="label">
 <abbr class="type" title="dom">local delivery</abbr>
 <abbr class="type" title="home">to my home</abbr>
 <abbr class="type" title="postal">of mail</abbr>
 <abbr class="type" title="parcel">and packages:</abbr>
<pre>
Mr.John Q. Public, Esq.
Mail Drop: TNE QB
123 Main Street
Any Town, CA  91921-1234
U.S.A.

</nowiki>

Note: the above hCard fragment uses a <pre> tag inside a property value to capture/represent explicit carriage returns ("\n" characters) from the vCard fragment.

this hCard fragment could be displayed as:

Please use the following address label for local delivery to my home of mail and packages:

Mr.John Q. Public, Esq.
Mail Drop: TNE QB
123 Main Street
Any Town, CA  91921-1234
U.S.A.

3.3.1 TEL Type Definition

TEL;TYPE=work,voice,pref,msg:+1-213-555-1234

this vCard fragment as an hCard fragment:

<span class="tel">
 <abbr class="type" title="pref">my</abbr> 
 <span class="type">work</span> 
 <abbr class="type" title="voice">phone</abbr>, with 
 <abbr class="type" title="msg">voicemail</abbr>:
 <span class="value">+1-213-555-1234</span>
</span>

this hCard fragment could be displayed as:

my work phone, with voicemail: +1-213-555-1234

3.3.2 EMAIL Type Definition

EMAIL Example 1

EMAIL;TYPE=internet:jqpublic@xyz.dom1.com

this vCard fragment as an hCard fragment:

<a class="email" href="mailto:jqpublic@xyz.dom1.com">email jqpublic</a>

this hCard fragment could be displayed as:

email jqpublic

EMAIL Example 2

EMAIL;TYPE=internet:jdoe@isp.net

this vCard fragment as an hCard fragment:

<a class="email" href="mailto:jdoe@isp.net">email jdoe</a>

this hCard fragment could be displayed as:

email jdoe

EMAIL Example 3

EMAIL;TYPE=internet,pref:jane_doe@abc.com

this vCard fragment as an hCard fragment:

<a class="email" href="mailto:jane_doe@abc.com">
 <abbr class="type" title="pref">preferred</abbr> 
 email for jane_doe
</a>

this hCard fragment could be displayed as:

preferred email for jane_doe

3.3.3 MAILER Type Definition

MAILER:PigeonMail 2.1

this vCard fragment as an hCard fragment:

Jane Doe uses <span class="mailer">PigeonMail 2.1</span> for email.

this hCard fragment could be displayed as:

Jane Doe uses PigeonMail 2.1 for email.

3.4.1 TZ Type Definition

TZ Example 1

TZ:-05:00

this vCard fragment as an hCard fragment:

<span class="tz">-05:00</span>

this hCard fragment could be displayed as:

-05:00

TZ Example 2

TZ;VALUE=text:-05:00; EST; Raleigh/North America
;This example has a single value, not a structure text value.

this vCard fragment as an hCard fragment:

<abbr class="tz"
 title="-05:00; EST; Raleigh/North America;This example has a single value, not a structure text value.">
 EST
</abbr>

this hCard fragment could be displayed as:

EST

3.4.2 GEO Type Definition

GEO:37.386013;-122.082932

this vCard fragment as an hCard fragment:

<span class="geo">
 <span class="latitude">37.386013</span>, 
 <span class="longitude">-122.082932</span>
</span>

this hCard fragment could be displayed as:

37.386013, -122.082932

3.5.1 TITLE Type Definition

TITLE:Director\, Research and Development

this vCard fragment as an hCard fragment:

<span class="title">Director, Research and Development</span>

this hCard fragment could be displayed as:

Director, Research and Development

3.5.2 ROLE Type Definition

ROLE:Programmer

this vCard fragment as an hCard fragment:

<span class="role">Programmer</span>

this hCard fragment could be displayed as:

Programmer

3.5.3 LOGO Type Definition

LOGO Example 1

LOGO;VALUE=uri:http://www.abc.com/pub/logos/abccorp.jpg

this vCard fragment as an hCard fragment

<img class="logo" src="http://www.abc.com/pub/logos/abccorp.jpg" alt="my logo" />

this hCard fragment could be displayed as (note: I used a real URL for the image):

mf-lg-ora.gif


LOGO Example 2

LOGO;ENCODING=b;TYPE=JPEG:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
<...the remainder of "B" encoded binary data...>

this vCard fragment as an hCard fragment

<img class="logo" src="data:image/jpeg;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
...remainder of B encoded binary data..." alt="" />

no display equivalent given, since data: URL from original example is incomplete.

3.5.4 AGENT Type Definition

AGENT Example 1

AGENT;VALUE=uri:
 CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com

this vCard fragment as an hCard fragment

<a class="agent" href="CID:JQPUBLIC.part3.960129T083020.xyzMail@host3.com">JQPUBLIC</a>

this hCard fragment could be displayed as:

JQPUBLIC

AGENT Example 2

AGENT:BEGIN:VCARD\nFN:Susan Thomas\nTEL:+1-919-555-
 1234\nEMAIL\;INTERNET:sthomas@host.com\nEND:VCARD\n

this vCard fragment as an hCard fragment

<span class="agent vcard">
 <a class="email fn" href="mailto:sthomas@host.com">Susan Thomas</a>,
 <span class="tel">+1-919-555-1234</span>
</span>

this hCard fragment could be displayed as:

Susan Thomas, +1-919-555-1234

Note: the vCard in the AGENT property vCard fragment is actually invalid since it lacks an "N" property. However, the hCard version *is* valid, since the implied N rule applies to the given "fn" property.

3.5.5 ORG Type Definition

ORG:ABC\, Inc.;North American Division;Marketing

this vCard fragment as an hCard fragment:

<span class="org">
 <span class="organization-name">ABC, Inc.</span>, 
 <span class="organization-unit">North American Division</span>,
 <span class="organization-unit">Marketing</span>,
</span>

this hCard fragment could be displayed as:

ABC, Inc., North American Division, Marketing

3.6.1 CATEGORIES Type Definition

CATEGORIES Example 1

CATEGORIES:TRAVEL AGENT

this vCard fragment as an hCard fragment:

<span class="category">TRAVEL AGENT</span>

this hCard fragment could be displayed as:

TRAVEL AGENT


CATEGORIES Example 2

CATEGORIES:INTERNET,IETF,INDUSTRY,INFORMATION TECHNOLOGY

this vCard fragment as an hCard fragment:

<span class="category">INTERNET</span>, 
<span class="category">IETF</span>, 
<span class="category">INDUSTRY</span>, 
<span class="category">INFORMATION TECHNOLOGY</span>

this hCard fragment would be displayed as:

INTERNET, IETF, INDUSTRY, INFORMATION TECHNOLOGY

3.6.2 NOTE Type Definition

NOTE:This fax number is operational 0800 to 1715
 EST\, Mon-Fri.

this vCard fragment as an hCard fragment:

<p class="note">This fax number is operational 0800 to 1715 EST, Mon-Fri.</p>

this hCard fragment could be displayed as:

This fax number is operational 0800 to 1715 EST, Mon-Fri.

3.6.3 PRODID Type Definition

PRODID:-//ONLINE DIRECTORY//NONSGML Version 1//EN

Note, this vCard property actually doesn't make sense as a hCard property, since it really should be filled in by whatever code transforms the hCard into a vCard, e.g. Brian Suda's X2V.

3.6.4 REV Type Definition

REV Example 1

REV:1995-10-31T22:27:10Z

this vCard fragment as an hCard fragment:

<abbr class="rev" title="1995-10-31T22:27:10Z">Updated: 10/31 10:27p</abbr>

this hCard fragment could be displayed as:

Updated: 10/31 10:27p

REV Example 2

REV:1997-11-15

this vCard fragment as an hCard fragment:

<abbr class="rev" title="1997-11-15">Updated: November 15</abbr>

this hCard fragment could be displayed as:

Updated: November 15

3.6.5 SORT-STRING Type Definition

SORT-STRING Example 1

FN:Rene van der Harten
N:van der Harten;Rene;J.;Sir;R.D.O.N.
SORT-STRING:Harten

this vCard fragment as an hCard fragment:

<span class="n">
 <span class="honorific-prefix">Sir</span>
 <span class="fn">
  <span class="given-name">Rene</span>
  <span class="family-name">
   van der <span class="sort-string">Harten</span>
  </span>
 </span>
 (<span class="additional-name">J.</span>),
 <span class="honorific-suffix">R.D.O.N.</span>
</span>

Note: The string "Harten" was NOT repeated in the hCard, even though it WAS repeated in the vCard (3 times! In N, FN, and SORT-STRING). The "SORT-STRING" property provides another good demonstration of how hCard enables better adherence to the DRY principle than vCard.

this hCard fragment could be displayed as:

Sir Rene van der Harten (J.), R.D.O.N.

SORT-STRING Example 2

FN:Robert Pau Shou Chang
N:Pau;Shou Chang;Robert
SORT-STRING:Pau

this vCard fragment as an hCard fragment:

<span class="fn n">
 <span class="additional-name">Robert</span>
 <span class="family-name sort-string">Pau</span>
 <span class="given-name">Shou Chang</span>
</span>

Note: Not only was the string "Pau" was NOT repeated in the hCard (better DRY principle adherence again), even though it WAS repeated in the vCard, but in this case since the "family-name" and "sort-string" are the same, we were able to use element conservation and use only one element for both properties.

this hCard fragment could be displayed as:

Robert Pau Shou Chang

SORT-STRING Example 3

FN:Osamu Koura
N:Koura;Osamu
SORT-STRING:Koura

this vCard fragment as an hCard fragment:

<span class="fn">
 Osamu <span class="sort-string">Koura</span>
</span>

Note: This example, in addition to illustrating better support for the DRY principle, also makes use of the Implied "N" Optimization.

this hCard fragment could be displayed as:

Osamu Koura

SORT-STRING Example 4

FN:Oscar del Pozo
N:del Pozo Triscon;Oscar
SORT-STRING:Pozo

this vCard fragment as an hCard fragment:

<span class="n">
 <span class="fn">
  <span class="given-name">Oscar</span>
  del <span class="sort-string">Pozo</span>
 </span>
 <span class="family-name" style="display:none">
  del Pozo Triscon
 </span>
</span>

Note: This example unfortunately could not completely adhere to the DRY principle due to the "FN" using a *substring* of the family-name, and in addition thus had to hide the extra "family-name" string value using CSS display:none, which in general should be avoided. Suggestion welcome for improvements on this hCard fragement.

this hCard fragment could be displayed as:

Oscar del Pozo

SORT-STRING Example 5

FN:Christine d'Aboville
N:d'Aboville;Christine
SORT-STRING:Aboville

this vCard fragment as an hCard fragment:

<span class="fn">
 Christine d'<span class="sort-string">Aboville</span>
</span>

Note: This example re-demonstrates the same hCard advantages/efficiencies demonstrated in example 3 above.

this hCard fragment could be displayed as:

Christine d'Aboville

3.6.6 SOUND Type Definition

SOUND Example 1

SOUND;TYPE=BASIC;VALUE=uri:CID:JOHNQPUBLIC.part8.
 19960229T080000.xyzMail@host1.com

this vCard fragment as an hCard fragment

<object class="sound" type="audio/basic"
 data="CID:JOHNQPUBLIC.part8.19960229T080000.xyzMail@host1.com">
pronounciation of "JOHN Q PUBLIC"
</object>

this hCard fragment would probably be displayed as

pronounciation of "JOHN Q PUBLIC"

unless your browser supports the MIME type "audio/basic" (defined in RFC2046 section 4.3) and has some way of retrieving "CID:" urls.

SOUND Example 2

SOUND;TYPE=BASIC;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
 AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
 ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
 <...the remainder of "B" encoded binary data...>

this vCard fragment as an hCard fragment

<object class="sound" 
data="data:audio/basic;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcN
 AQEEBQAwdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bm
 ljYXRpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
 ...the remainder of "B" encoded binary data...">
pronounciation
</object>

no display equivalent given, since data: URL from original example is incomplete.

3.6.7 UID Type Definition

UID:19950401-080045-40000F192713-0052

this vCard fragment as an hCard fragment

Unique id: 
 <span class="uid">19950401-080045-40000F192713-0052</span>

this hCard fragment could be displayed as

Unique id:19950401-080045-40000F192713-0052

Note: in practice I don't think I've seen globally unique IDs for "contact info" records published on the web, but perhaps I am not considering enough examples.


3.6.8 URL Type Definition

URL:http://www.swbyps.restaurant.french/~chezchic.html

this vCard fragment as an hCard fragment

<a class="url" href="http://www.swbyps.restaurant.french/~chezchic.html">Chez Chic</a>

this hCard fragment could be displayed as

Chez Chic


3.7.1 CLASS Type Definition

CLASS Example 1

CLASS:PUBLIC

this vCard fragment as an hCard fragment

<span class="class">PUBLIC</span>

this hCard fragment could be displayed as

PUBLIC

CLASS Example 2

CLASS:PRIVATE

this vCard fragment as an hCard fragment

<span class="class">PRIVATE</span>

this hCard fragment could be displayed as

PRIVATE

CLASS Example 3

CLASS:CONFIDENTIAL

this vCard fragment as an hCard fragment

<span class="class">CONFIDENTIAL</span>

this hCard fragment could be displayed as

CONFIDENTIAL

3.7.2 KEY Type Definition

KEY;ENCODING=b:MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA
 wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX
 Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
 ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj
 E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD
 VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx
 MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz
 Y2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ
 EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2
 dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB
 EGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau
 +hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP
 mx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//y
 rZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7
 UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ==

this vCard fragment as an hCard fragment

<object class="key" type="application/octet-stream"
 data="data:application/octet-stream;base64,MIICajCCAdOgAwIBAgICBEUwDQYJKoZIhvcNAQEEBQA
 wdzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENbW11bmljYX
 Rpb25zIENvcnBvcmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0
 ZW1zMRwwGgYDVQQDExNyb290Y2EubmV0c2NhcGUuY29tMB4XDTk3MDYwNj
 E5NDc1OVoXDTk3MTIwMzE5NDc1OVowgYkxCzAJBgNVBAYTAlVTMSYwJAYD
 VQQKEx1OZXRzY2FwZSBDb21tdW5pY2F0aW9ucyBDb3JwLjEYMBYGA1UEAx
 MPVGltb3RoeSBBIEhvd2VzMSEwHwYJKoZIhvcNAQkBFhJob3dlc0BuZXRz
 Y2FwZS5jb20xFTATBgoJkiaJk/IsZAEBEwVob3dlczBcMA0GCSqGSIb3DQ
 EBAQUAA0sAMEgCQQC0JZf6wkg8pLMXHHCUvMfL5H6zjSk4vTTXZpYyrdN2
 dXcoX49LKiOmgeJSzoiFKHtLOIboyludF90CgqcxtwKnAgMBAAGjNjA0MB
 EGCWCGSAGG+EIBAQQEAwIAoDAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau
 +hUMbsQukjANBgkqhkiG9w0BAQQFAAOBgQBexv7o7mi3PLXadkmNP9LcIP
 mx93HGp0Kgyx1jIVMyNgsemeAwBM+MSlhMfcpbTrONwNjZYW8vJDSoi//y
 rZlVt9bJbs7MNYZVsyF1unsqaln4/vy6Uawfg8VUMk1U7jt8LYpo4YULU7
 UZHPYVUaSgVttImOHZIKi4hlPXBOhcUQ==">
Key
</object>

this hCard fragment could be displayed as

Key

Note: Because of the lack of a TYPE value in the RFC2426 example, I substituted application/octet-stream. Clearly for it to be of some use, the type specified must be some sort of key or certificate mime type.

7. Authors' Addresses

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


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

Note that both of these vCards are invalid since they lack the REQUIRED "N" property which is quite ironic, since these are the vCards of the authors themselves.

Nonetheless, these vCards can be represented by the following hCards:

<div class="vcard">
<a class="url fn" href="http://home.earthlink.net/~fdawson">Frank Dawson</a>
<div class="org">Lotus Development Corporation</div>
<div class="adr">
 <span class="type">work</span> address 
(<abbr class="type" title="postal">mail</abbr> and
 <abbr class="type" title="parcel">packages</abbr>):
 <div class="street-address">6544 Battleford Drive</div>
 <span class="locality">Raleigh</span>
 <span class="region">NC</span>
 <span class="postal-code">27613-3502</span>
 <div class="country-name">U.S.A.</div>
</div>
<div class="tel">
 <span class="value">+1-919-676-9515</span> 
(<abbr class="type" title="WORK">w</abbr>,
 <abbr class="type" title="VOICE">v</abbr><abbr class="type" title="MSG">m</abbr>)
</div>
<div class="tel">
 <span class="value">+1-919-676-9564</span>
(<abbr class="type" title="WORK">w</abbr><abbr class="type" title="FAX">f</abbr>)
</div>
<a class="email" href="mailto:Frank_Dawson@Lotus.com">
 <span class="type">pref</span><span>erred email</span>
</a>,
<a class="email" href="mailto:fdawson@earthlink.net">
 alternate email
</a>
</div>
<div class="vcard">
<a class="email fn" href="mailto:howes@netscape.com">Tim Howes</a>
<div class="org">Netscape Communications Corp.</div>
<div class="adr">
 <span class="type">work</span> address:
 <div class="street-address">501 E. Middlefield Rd.</div>
 <span class="locality">Mountain View</span>, 
 <span class="region">CA</span>
 <span class="postal-code">94043</span>
 <div class="country-name">U.S.A.</div>
</div>
<div class="tel">
 <span class="value">+1-415-937-3419</span> 
(<abbr class="type" title="WORK">w</abbr>,
 <abbr class="type" title="VOICE">v</abbr><abbr class="type" title="MSG">m</abbr>)
</div>
<div class="tel">
 <span class="value">+1-415-528-4164</span>
(<abbr class="type" title="WORK">w</abbr><abbr class="type" title="FAX">f</abbr>)
</div>
</div>

this hCards could be displayed as

Frank Dawson

Lotus Development Corporation

work address (mail and packages):

6544 Battleford Drive

Raleigh NC 27613-3502

U.S.A.

+1-919-676-9515 (w, vm)

+1-919-676-9564 (wf)

preferred email, alternate email

Tim Howes

Netscape Communications Corp.

work address:

501 E. Middlefield Rd.

Mountain View, CA 94043

U.S.A.

+1-415-937-3419 (w, vm)

+1-415-528-4164 (wf)


This is a sub-page of hcard-examples