diff -Naru old/XML-RSS-1.56/lib/XML/RSS.pm new/XML-RSS-1.56/lib/XML/RSS.pm
--- old/XML-RSS-1.56/lib/XML/RSS.pm 2014-12-04 22:02:56.000000000 +0600
+++ new/XML-RSS-1.56/lib/XML/RSS.pm 2015-10-12 18:32:34.256889920 +0600
@@ -933,6 +933,12 @@
# beginning of RSS 0.91
if ($el eq 'rss') {
+ if (!$self->{rss_namespace} && grep { $_ eq '#default' } $parser->current_ns_prefixes) {
+ # actually RSS may not has default namespace
+ # so, try to ignore it
+ $self->{rss_namespace} = $parser->expand_ns_prefix('#default');
+ }
+
if (exists($attribs{version})) {
$self->{_internal}->{version} = $attribs{version};
}
diff -Naru old/XML-RSS-1.56/t/2.0-parse-w-ns.t new/XML-RSS-1.56/t/2.0-parse-w-ns.t
--- old/XML-RSS-1.56/t/2.0-parse-w-ns.t 1970-01-01 07:00:00.000000000 +0700
+++ new/XML-RSS-1.56/t/2.0-parse-w-ns.t 2015-10-12 18:27:02.394291637 +0600
@@ -0,0 +1,110 @@
+use strict;
+use warnings;
+use Test::More;
+
+use constant RSS_VERSION => "2.0";
+use constant RSS_CHANNEL_TITLE => "Example 2.0 Channel";
+
+use constant RSS_DOCUMENT => qq(<?xml version="1.0"?>
+<rss xmlns="
http://backend.userland.com/rss2" version="2.0">
+ <channel>
+ <title>Example 2.0 Channel</title>
+ <link>
http://example.com/</link>
+ <description>To lead by example</description>
+ <language>en-us</language>
+ <copyright>All content Public Domain, except comments which remains copyright the author</copyright>
+ <managingEditor>editor\@example.com</managingEditor>
+ <webMaster>webmaster\@example.com</webMaster>
+ <docs>
http://backend.userland.com/rss</docs>
+ <category domain="
http://www.dmoz.org">Reference/Libraries/Library_and_Information_Science/Technical_Services/Cataloguing/Metadata/RDF/Applications/RSS/</category>
+ <generator>The Superest Dooperest RSS Generator</generator>
+ <lastBuildDate>Mon, 02 Sep 2002 03:19:17 GMT</lastBuildDate>
+ <ttl>60</ttl>
+
+ <item>
+ <title>News for September the Second</title>
+ <link>
http://example.com/2002/09/02</link>
+ <description>other things happened today</description>
+ <comments>
http://example.com/2002/09/02/comments.html</comments>
+ <author>joeuser\@example.com</author>
+ <pubDate>Mon, 02 Sep 2002 03:19:00 GMT</pubDate>
+ <guid isPermaLink="true">
http://example.com/2002/09/02</guid>
+ </item>
+
+ <item>
+ <title>News for September the First</title>
+ <link>
http://example.com/2002/09/01</link>
+ <description>something happened today</description>
+ <comments>
http://example.com/2002/09/01/comments.html</comments>
+ <author>joeuser\@example.com</author>
+ <pubDate>Sun, 01 Sep 2002 12:01:00 GMT</pubDate>
+ <guid isPermaLink="true">
http://example.com/2002/09/02</guid>
+ </item>
+
+ </channel>
+</rss>);
+
+plan tests => 7;
+
+use_ok("XML::RSS");
+
+my $xml = XML::RSS->new();
+isa_ok($xml,"XML::RSS");
+
+eval { $xml->parse(RSS_DOCUMENT); };
+is($@,'',"Parsed RSS feed");
+
+cmp_ok($xml->{'_internal'}->{'version'},"eq",RSS_VERSION,"Is RSS version ".RSS_VERSION);
+cmp_ok($xml->{channel}->{'title'},"eq",RSS_CHANNEL_TITLE,"Feed title is ".RSS_CHANNEL_TITLE);
+cmp_ok(ref($xml->{items}),"eq","ARRAY","\$xml->{items} is an ARRAY ref");
+
+my $ok = 1;
+
+foreach my $item (@{$xml->{items}}) {
+
+ my $min = 0;
+ foreach my $el ("title","description") {
+ if (exists $item->{$el}) {
+ $min ||= 1;
+ }
+ }
+
+ $ok = $min;
+ last if (! $ok);
+}
+
+ok($ok,"All items have either a title or a description element");
+
+
+__END__
+
+=head1 NAME
+
+2.0-parse-ns.t - tests for parsing RSS 2.0 data with default namespace (which is not actually valid) using XML::RSS.pm
+
+=head1 SYNOPSIS
+
+ use Test::Harness qw (runtests);
+ runtests (./XML-RSS/t/*.t);
+
+=head1 DESCRIPTION
+
+Tests for parsing RSS 2.0 data with XML::RSS.pm
+
+=head1 VERSION
+
+$Revision: 1.2 $
+
+=head1 DATE
+
+$Date: 2002/11/19 23:56:53 $
+
+=head1 AUTHOR
+
+Aaron Straup Cope
+
+=head1 SEE ALSO
+
+
http://backend.userland.com/rss2
+
+=cut