Fix 'base' stuff
[catagits/XML-Feed.git] / lib / XML / Feed / Format / Atom.pm
index b5063cd..0140d5b 100644 (file)
@@ -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) = @_;