| Text-Microformat documentation | Contained in the Text-Microformat distribution. |
Text::Microformat::Element::hCard - hCard plugin for Text::Microformat
Keith Grennan, <kgrennan at cpan.org>
Log bugs and feature requests here: http://code.google.com/p/ufperl/issues/list
Project homepage: http://code.google.com/p/ufperl/
Copyright 2007 Keith Grennan, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Text-Microformat documentation | Contained in the Text-Microformat distribution. |
package Text::Microformat::Element::hCard; use warnings; use strict; use base 'Text::Microformat::Element'; __PACKAGE__->_init({ criteria => { class => 'vcard', }, schema => { fn => [], n => [qw/family-name given-name additional-name honorific-prefix honorific-suffix/], nickname => [], 'sort-string' => [], url => 'URI', email => [qw/type value/], tel => [qw/type value/], adr => [qw/post-office-box extended-address street-address locality region postal-code country-name type value/], label => [], geo => [qw/latitude longitude/], tz => [], photo => 'URI', logo => 'URI', sound => 'URI', bday => [], title => [], role => [], org => [qw/organization-name organization-unit/], category => [], note => [], class => [], key => [], mailer => [], uid => [], rev => [], }, }); package Text::Microformat::Element::hCard::HasValue; use warnings; use strict; use base 'Text::Microformat::Element'; sub ToHash { my $self = shift; if ($self->value and @{$self->value}) { return $self->SUPER::ToHash; } else { return $self->Value; } } package Text::Microformat::Element::hCard::email; use warnings; use strict; our @ISA = 'Text::Microformat::Element::hCard::HasValue'; package Text::Microformat::Element::hCard::tel; use warnings; use strict; our @ISA = 'Text::Microformat::Element::hCard::HasValue';
1;