Text::Microformat::Element::URI - a Microformat URI element


Text-Microformat documentation Contained in the Text-Microformat distribution.

Index


Code Index:

NAME

Top

Text::Microformat::Element::URI - a Microformat URI element

SEE ALSO

Top

Text::Microformat, http://microformats.org

AUTHOR

Top

Keith Grennan, <kgrennan at cpan.org>

BUGS

Top

Log bugs and feature requests here: http://code.google.com/p/ufperl/issues/list

SUPPORT

Top

Project homepage: http://code.google.com/p/ufperl/

COPYRIGHT & LICENSE

Top


Text-Microformat documentation Contained in the Text-Microformat distribution.

package Text::Microformat::Element::URI;
use warnings;
use strict;
use base 'Text::Microformat::Element';

sub MachineValue {
	my $self = shift;
	my $tag = defined $self->_element->local_name ? $self->_element->local_name : "";
	if ($tag eq 'a') {
		return $self->_element->attr('href');
	}
	elsif ($tag eq 'img') {
		return $self->_element->attr('src');
	}
	elsif ($tag eq 'object') {
		return $self->_element->attr('data');
	}
	else {
		return $self->SUPER::MachineValue;
	}
}


1;