HTML-Microformats
view release on metacpan or search on metacpan
lib/HTML/Microformats/DocumentContext.pm view on Meta::CPAN
{
my @hcards = HTML::Microformats::Format::hCard->extract_all($self->document->documentElement, $self);
my ($shallowest, $shallowest_depth);
HCARD: foreach my $hc (@hcards)
{
next unless ref $hc;
my $address = searchAncestorTag('address', $hc->element);
next unless defined $address;
my @bits = split m'/', $address;
my $address_depth = scalar(@bits);
if ($address_depth < $shallowest_depth
|| !defined $shallowest)
{
$shallowest_depth = $address_depth;
$shallowest = $hc;
}
}
$self->{'contact_hcard'} = $shallowest;
( run in 0.988 second using v1.01-cache-2.11-cpan-71847e10f99 )