SYNOPSIS

 use Data::Dumper;
 use HTML::Microformats::DocumentContext;
 use HTML::Microformats::Format::adr;

 my $context = HTML::Microformats::DocumentContext->new($dom, $uri);
 my @adrs    = HTML::Microformats::Format::adr->extract_all(
                   $dom->documentElement, $context);
 foreach my $adr (@adrs)
 {
   print Dumper($adr->data) . "\n";
 }

DESCRIPTION

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

MICROFORMAT

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

  • 'type' property This module is used by HTML::Microformats::Format::hCard to handle addresses within the hCard microformat. hCard addresses include a 'type' property indicating the address type (e.g. home, work, etc). This module supports the 'type' property whether or the address is part of an hCard.

  • Embedded geo microformat If an instance of the geo microformat is found embedded within an address, that geographic location will be associated with the address.

RDF OUTPUT

Data is returned using the W3C's vCard vocabulary (<http://www.w3.org/2006/vcard/ns#>) and occasional other terms.

Like how HTML::Microformats::Format::hCard differentiates between the business card and the entity represented by the card, this module differentiates between the address and the location represented by it. The former is an abstract social construction, its definition being affected by ephemeral political boundaries; the latter is a physical place. Theoretically multiple addresses could represent the same, or overlapping locations, though this module does not generate any data where that is the case.

Where possible, the module uses Locale::Country to determine the two letter \s-1ISO\s0 code for the country of the location, and include this in the \s-1RDF\s0 output.

BUGS

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

RELATED TO HTML::Microformats::Format::adr…

HTML::Microformats::Format, HTML::Microformats, HTML::Microformats::Format::hCard, HTML::Microformats::Format::geo.

AUTHOR

Toby Inkster <[email protected]>.

COPYRIGHT AND LICENCE

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.

DISCLAIMER OF WARRANTIES

\s-1THIS\s0 \s-1PACKAGE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.