HTML::Microformats::Format::hCard(3pm) User Contributed Perl Documentation HTML::Microformats::Format::hCard(3pm)

HTML::Microformats::Format::hCard - the hCard microformat

 use HTML::Microformats::DocumentContext;
 use HTML::Microformats::Format::hCard;
 my $context = HTML::Microformats::DocumentContext->new($dom, $uri);
 my @cards   = HTML::Microformats::Format::hCard->extract_all(
                   $dom->documentElement, $context);
 foreach my $card (@cards)
 {
   print $card->get_fn . "\n";
 }

HTML::Microformats::Format::hCard inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc.

  • "to_vcard"

    This method exports the hCard as a vCard 3.0. It requires RDF::vCard to work, and will throw an error at run-time if it's not available.

  • "to_vcard4"

    This method exports the hCard as a vCard 3.0. It requires RDF::vCard to work, and will throw an error at run-time if it's not available.

  • "to_vcard4_xml"

    This method exports the hCard as a vCard XML. It requires RDF::vCard and XML::LibXML to work, and will throw an error at run-time if it's not available.

HTML::Microformats::Format::hCard supports hCard as described at <http://microformats.org/wiki/hcard>, with the following additions:

Data is returned using the W3C's vCard vocabulary (<http://www.w3.org/2006/vcard/ns#>) with some supplemental terms from Toby Inkster's vCard extensions vocabulary (<http://buzzword.org.uk/rdf/vcardx#>) and occasional other terms.

After long deliberation on the "has-a/is-a issue", the author of this module decided that the holder of a vCard and the vCard itself should be modelled as two separate resources, and this is how the data is returned. Some information about the holder of the vCard can be inferred from information about the vCard; for instance, the vCard's fn property can be used to determin the holder's foaf:name. This module uses FOAF (<http://xmlns.com/foaf/0.1/>) to represent information about the holder of the vCard.

Please report any bugs to <http://rt.cpan.org/>.

HTML::Microformats::Format, HTML::Microformats.

Toby Inkster <tobyink@cpan.org>.

Copyright 2008-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

2021-09-12 perl v5.32.1