Use Brian Suda's xhtml2vcard.xsl tool to extract the hCard and generate a vCard (.vcf file). In the
lab 1 folder is run.bat. Double click on it, and it will invoke Brian's tool.
Determining the Value of fn, Case 1
Case 1: The contents of the fn element is pure text.
The value of fn is the pure text.
Example:
<cite class="fn">Dr. John Q. Smith, M.D.</cite>
The value of fn is:
Dr. John Q. Smith, M.D.
Determining the Value of fn, Case 2
Case 2: The fn element has one or more "value" elements.
Example:
<p class="fn">
<span class="value">John </span>
is the speaker. Dr.
<span class="value">Smith</span>
will talk on ...
</p>
The value of fn is the concatenation of the value elements.
concatenation('John ', 'Smith') = John Smith
Determining the Value of fn, Case 3
Case 3: The fn element has one or more child elements.
The value of fn is obtained as follows:
concatenate the text outside the child elements with the text inside the child elements
normalize the resulting string (i.e., strip leading and trailing spaces, replace consecutive white spaces with a single space)
Example:
<p class="fn n">
<span class="given-name">John</span>
<span class="family-name">Smith</span>
</p>
Determining the Value of fn, Case 3
Before normalization:
'
John
Smith
'
After normalization, the value of fn is:
'John Smith'
Determining the Value of fn, Case 4
Case 4: The fn element is abbr.
The value of fn is the value of the abbr "title" attribute.
Example:
<abbr class="fn" title="John Smith">John</abbr>
The value of fn is:
John Smith
nickname Property
nickname - use to specify the nickname of the person.
Example: markup this HTML text using the hCard properties:
<cite>Roger (Rocket) Clemens<cite> is the pitcher for the Houston Astros.
Notice that I added information not present in the original HTML text; namely, that this
is his preferred, home address.
type Values
If no type subproperty is specified then it defaults to type=intl, postal, parcel, work (i.e., the address
is an international work address, for both postal and parcel deliveries).
The type values are case insensitive. Thus, home, Home, HOME are all equivalent.
adr Microformat
We have seen that adr is a "property" of the hCard Microformat.
adr is also a standalone Microformat. It can be used on its own, independent of hCard.
The adr profile URL is the same as hCard's profile URL.