X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FXML%2FFeed%2FFormat%2FAtom.pm;h=0140d5bc40be8084d651391908287dda61d1f869;hb=4ad13011b5d49c3a2f38cbf9e625208d627be405;hp=b5063cdcfda8befd9cc194ef686971608779b705;hpb=948f9350262bcf681e0d4e18eb3fa7208e14a448;p=catagits%2FXML-Feed.git diff --git a/lib/XML/Feed/Format/Atom.pm b/lib/XML/Feed/Format/Atom.pm index b5063cd..0140d5b 100644 --- a/lib/XML/Feed/Format/Atom.pm +++ b/lib/XML/Feed/Format/Atom.pm @@ -15,12 +15,13 @@ XML::Atom::Entry->mk_elem_accessors(qw( lat long ), ['http://www.w3.org/2003/01/ use XML::Atom::Content; sub identify { - my $class = shift; - my $xml = shift; - my $tag = $class->_get_first_tag($xml); - return ($tag eq 'feed'); + my $class = shift; + my $xml = shift; + my $tag = $class->_get_first_tag($xml); + return ($tag eq 'feed'); } + sub init_empty { my ($feed, %args) = @_; $args{'Version'} ||= '1.0'; @@ -29,31 +30,6 @@ sub init_empty { $feed; } -# monkey patch -{ - my $sub = sub { - my $item = shift; - if (XML::Atom::LIBXML) { - my $elem = $item->elem; - if (@_) { - $elem->setAttributeNS('http://www.w3.org/XML/1998/namespace', - 'base', $_[0]); - } - return $elem->getAttributeNS('http://www.w3.org/XML/1998/namespace', 'base'); - } else { - if (@_) { - $item->elem->setAttribute('xml:base', $_[0]); - } - return $item->elem->getAttribute('xml:base'); - } - - }; - no strict 'refs'; - *XML::Atom::Feed::base = $sub unless XML::Atom::Feed->can('base'); - *XML::Atom::Entry::base = $sub unless XML::Atom::Entry->can('base'); - *XML::Atom::Content::base = $sub unless XML::Atom::Content->can('base'); -} - sub init_string { my $feed = shift; my($str) = @_;