r59765 - in /trunk/libxml-rss-libxml-perl: ./ debian/ inc/Module/ inc/Module/Install/ lib/XML/RSS/ lib/XML/RSS/LibXML/ t/ t/generated/ xt/

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Wed Jun 23 16:20:49 UTC 2010


Author: gregoa
Date: Wed Jun 23 16:20:27 2010
New Revision: 59765

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59765
Log:
* New upstream release 0.3100.

Modified:
    trunk/libxml-rss-libxml-perl/Changes
    trunk/libxml-rss-libxml-perl/META.yml
    trunk/libxml-rss-libxml-perl/debian/changelog
    trunk/libxml-rss-libxml-perl/inc/Module/Install.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/AutoInstall.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/Base.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/Can.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/Fetch.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/Include.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/Makefile.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/Metadata.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/Win32.pm
    trunk/libxml-rss-libxml-perl/inc/Module/Install/WriteAll.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/ImplBase.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/MagicElement.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_9.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_91.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_92.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V1_0.pm
    trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V2_0.pm
    trunk/libxml-rss-libxml-perl/t/1.0-parse.t
    trunk/libxml-rss-libxml-perl/t/2.0-generate.t
    trunk/libxml-rss-libxml-perl/t/2.0-parse.t
    trunk/libxml-rss-libxml-perl/t/generated/1.0-generated.xml
    trunk/libxml-rss-libxml-perl/t/generated/2.0-generated.xml
    trunk/libxml-rss-libxml-perl/t/items-are-0.t
    trunk/libxml-rss-libxml-perl/xt/pod-coverage.t
    trunk/libxml-rss-libxml-perl/xt/pod.t

Modified: trunk/libxml-rss-libxml-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/Changes?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/Changes (original)
+++ trunk/libxml-rss-libxml-perl/Changes Wed Jun 23 16:20:27 2010
@@ -2,6 +2,17 @@
 =======
 
 Except where noted, all changes made by Daisuke Maki
+
+0.3100 - 22 Jun 2010
+  * Bunch of changes by David Wheeler, granting a minor version++ :)
+    Note that changes about stringifying child elements may have affect
+    some users. Drop me a line if you have a problem.
+
+  - Add support for xml:base in RSS 2.0. (theory)
+  - Parse and include items in RSS 2.0 feeds without a title or description. (theory)
+  - The encoding() method now returns the encoding of a parsed feed. (theory)
+  - Parser recognizes elements that should not have children and stringifies 
+    the children of such elements when it finds children. (theory)
 
 0.3005 - 3 Jun 2010
   - rt #58067 Document create_libxml() (theory)

Modified: trunk/libxml-rss-libxml-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/META.yml?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/META.yml (original)
+++ trunk/libxml-rss-libxml-perl/META.yml Wed Jun 23 16:20:27 2010
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.98'
+generated_by: 'Module::Install version 0.99'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -29,4 +29,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/lestrrat/XML-RSS-LibXML.git
-version: 0.3005
+version: 0.3100

Modified: trunk/libxml-rss-libxml-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/debian/changelog?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/debian/changelog (original)
+++ trunk/libxml-rss-libxml-perl/debian/changelog Wed Jun 23 16:20:27 2010
@@ -1,4 +1,4 @@
-libxml-rss-libxml-perl (0.3005-1) UNRELEASED; urgency=low
+libxml-rss-libxml-perl (0.3100-1) UNRELEASED; urgency=low
 
   TODO: Check license of data/2.0/*, data/rss-permalink.xml, data/merlyn1.rss.
   Replace with something else?
@@ -12,9 +12,12 @@
     permitted by Debian Policy 3.8.3).
 
   [ Ansgar Burchardt ]
-  * New upstream release.
+  * New upstream release 0.3005.
 
- -- Ansgar Burchardt <ansgar at 43-1.org>  Thu, 03 Jun 2010 18:52:12 +0900
+  [ gregor herrmann ]
+  * New upstream release 0.3100.
+
+ -- gregor herrmann <gregoa at debian.org>  Wed, 23 Jun 2010 18:18:26 +0200
 
 libxml-rss-libxml-perl (0.3004-1) unstable; urgency=low
 

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install.pm Wed Jun 23 16:20:27 2010
@@ -22,7 +22,6 @@
 use Cwd        ();
 use File::Find ();
 use File::Path ();
-use FindBin;
 
 use vars qw{$VERSION $MAIN};
 BEGIN {
@@ -32,7 +31,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -231,7 +230,8 @@
 sub new {
 	my ($class, %args) = @_;
 
-	FindBin->again;
+    delete $INC{'FindBin.pm'};
+    require FindBin;
 
 	# ignore the prefix on extension modules built from top level.
 	my $base_path = Cwd::abs_path($FindBin::Bin);

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/AutoInstall.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/AutoInstall.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/AutoInstall.pm Wed Jun 23 16:20:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/Base.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/Base.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/Base.pm Wed Jun 23 16:20:27 2010
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 }
 
 # Suspend handler for "redefined" warnings

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/Can.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/Can.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/Can.pm Wed Jun 23 16:20:27 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/Fetch.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/Fetch.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/Fetch.pm Wed Jun 23 16:20:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/Include.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/Include.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/Include.pm Wed Jun 23 16:20:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/Makefile.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/Makefile.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/Makefile.pm Wed Jun 23 16:20:27 2010
@@ -8,7 +8,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/Metadata.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/Metadata.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/Metadata.pm Wed Jun 23 16:20:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/Win32.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/Win32.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/Win32.pm Wed Jun 23 16:20:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/inc/Module/Install/WriteAll.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/inc/Module/Install/WriteAll.pm (original)
+++ trunk/libxml-rss-libxml-perl/inc/Module/Install/WriteAll.pm Wed Jun 23 16:20:27 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.98';
+	$VERSION = '0.99';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML.pm Wed Jun 23 16:20:27 2010
@@ -8,7 +8,7 @@
 use XML::LibXML::XPathContext;
 use XML::RSS::LibXML::Namespaces qw(NS_RSS10);
 
-our $VERSION = '0.3005';
+our $VERSION = '0.3100';
 
 __PACKAGE__->mk_accessors($_) for qw(impl encoding strict namespaces modules output stylesheets _internal num_items);
 
@@ -21,6 +21,7 @@
     my $self = bless {
         impl       => $impl,
         version    => $args{version},
+        base       => $args{base},
         encoding   => $args{encoding} || 'UTF-8',
         strict     => exists $args{strict} ? $args{strict} : 0,
         namespaces => {},
@@ -32,7 +33,6 @@
             recover => 1,
             load_ext_dtd => 0
         },
-        'xml:base' => $args{'xml:base'},
     }, $class;
 
     $self->impl->reset($self);
@@ -68,6 +68,17 @@
         $self->internal('version', $_[0]);
     }
     return $version;
+}
+
+sub base
+{
+    my $self = shift;
+    my $base = $self->{base};
+    if (@_) {
+        $self->{base} = $_[0];
+        $self->internal('base', $_[0]);
+    }
+    return $base;
 }
 
 sub add_module
@@ -299,6 +310,7 @@
   # XML::RSS::LibXML only methods
 
   my $version     = $rss->version;
+  my $base        = $rss->base;
   my $hash        = $rss->namespaces;
   my $list        = $rss->items;
   my $encoding    = $rss->encoding;
@@ -358,7 +370,7 @@
 
 For example, suppose you have a tag like the following:
 
-  <rss version="2.0">
+  <rss version="2.0" xml:base="http://example.com/">
   ...
     <channel>
       <tag attr1="val1" attr2="val3">foo bar baz</tag>
@@ -377,13 +389,14 @@
 
 =head2 new(%args)
 
-Creates a new instance of XML::RSS::LibXML. You may specify a version in the
-constructor args to control which output format as_string() will use.
-
-  XML::RSS::LibXML->new(version => '1.0');
-
-You can also specify the encoding that you expect this RSS object to use
-when creating an RSS string
+Creates a new instance of XML::RSS::LibXML. You may specify a version or an
+XML base in the constructor args to control which output format as_string()
+will use.
+
+  XML::RSS::LibXML->new(version => '1.0', base => 'http://example.com/');
+
+The XML base will be included only in RSS 2.0 output. You can also specify the
+encoding that you expect this RSS object to use when creating an RSS string
 
   XML::RSS::LiBXML->new(encoding => 'euc-jp');
 

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/ImplBase.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/ImplBase.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/ImplBase.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/ImplBase.pm Wed Jun 23 16:20:27 2010
@@ -137,6 +137,17 @@
 
 sub parse_dom { }
 
+sub parse_base
+{
+    my ($self, $c, $dom) = @_;
+    my $xc = $c->create_xpath_context(scalar $c->namespaces);
+    if (my $b = $xc->findvalue('/rss/@xml:base', $dom)) {
+        $c->base($b);
+    } else {
+        $c->base(undef);
+    }
+}
+
 sub parse_namespaces
 {   
     my ($self, $c, $dom) = @_;
@@ -182,6 +193,10 @@
     
 sub parse_misc_simple
 {
+}
+
+sub may_have_children {
+    qw(channel item image textinput skipHours skipDays)
 }
 
 sub parse_children
@@ -200,7 +215,12 @@
         $name = 'textinput' if ($name eq 'textInput');
         my $val    = undef;
         if ($child->findnodes('./*')) {
-            $val = $self->parse_children($c, $child);
+            if (!grep { $_ eq $name } $self->may_have_children) {
+                # Urk. Should have been encoded and wasn't! Stupid thing.
+                $val = join '', map { $_->toString } $child->childNodes;
+            } else {
+                $val = $self->parse_children($c, $child);
+            }
         } else {
             my $text   = $child->textContent();
             $text = '' if $text !~ /\S/ ;

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/MagicElement.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/MagicElement.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/MagicElement.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/MagicElement.pm Wed Jun 23 16:20:27 2010
@@ -24,8 +24,8 @@
     if (ref($attrs) eq 'ARRAY') {
         %attrs = map { (
             $_->prefix && $_->prefix ne 'xmlns' ?
-                sprintf('%s:%s', $_->prefix, $_->localname) :
-                $_->localname
+                sprintf('%s:%s', $_->prefix, $_->localname || '') :
+                $_->localname || ''
             , $_->getData
         ) } @$attrs;
         @attrs = map { $_->getName } @$attrs;

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_9.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_9.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_9.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_9.pm Wed Jun 23 16:20:27 2010
@@ -99,6 +99,7 @@
 
     $c->reset;
     $c->version(0.9);
+    $c->encoding($dom->encoding);
     $self->parse_namespaces($c, $dom);
     $c->internal('prefix', 'rss09');
     # Check if we have non-default RSS namespace
@@ -312,4 +313,4 @@
     return $item;
 }
 
-1;
+1;

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_91.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_91.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_91.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_91.pm Wed Jun 23 16:20:27 2010
@@ -154,6 +154,7 @@
 
     $c->reset;
     $c->version('0.91');
+    $c->encoding($dom->encoding);
     $self->parse_namespaces($c, $dom);
     $self->parse_channel($c, $dom);
     $self->parse_items($c, $dom);
@@ -274,4 +275,4 @@
     }
 }
 
-1;
+1;

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_92.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_92.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_92.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V0_92.pm Wed Jun 23 16:20:27 2010
@@ -14,6 +14,7 @@
 
     $c->reset;
     $c->version('0.92');
+    $c->encoding($dom->encoding);
     $self->parse_namespaces($c, $dom);
     $self->parse_channel($c, $dom);
     $self->parse_items($c, $dom);

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V1_0.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V1_0.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V1_0.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V1_0.pm Wed Jun 23 16:20:27 2010
@@ -43,6 +43,7 @@
 
     $c->reset;
     $c->version('1.0');
+    $c->encoding($dom->encoding);
     $self->parse_namespaces($c, $dom);
 
     $c->internal('prefix', 'rss10');
@@ -288,4 +289,4 @@
     $channel->appendChild($items);
 }
 
-1;
+1;

Modified: trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V2_0.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V2_0.pm?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V2_0.pm (original)
+++ trunk/libxml-rss-libxml-perl/lib/XML/RSS/LibXML/V2_0.pm Wed Jun 23 16:20:27 2010
@@ -115,19 +115,6 @@
     };
 }
 
-sub add_item
-{
-    my $self = shift;
-    my $c    = shift;
-    my $h    = ref($_[0]) eq 'HASH' ? $_[0] : {@_};
-
-    if (! defined $h->{description} && ! defined $h->{title}) {
-        return;
-    }
-
-    $self->SUPER::add_item($c, $h);
-}
-
 sub parse_dom
 {
     my $self = shift;
@@ -136,11 +123,14 @@
 
     $c->reset;
     $c->version('2.0');
+    $c->encoding($dom->encoding);
+    $self->parse_base($c, $dom);
     $self->parse_namespaces($c, $dom);
     $self->parse_channel($c, $dom);
     $self->parse_items($c, $dom);
     $self->parse_misc_simple($c, $dom);
 }
+
 
 sub parse_channel
 {
@@ -244,6 +234,9 @@
     my ($self, $c, $dom) = @_;
     my $root = $dom->createElement('rss');
     $root->setAttribute(version => '2.0');
+    if (my $base = $c->base) {
+        $root->setAttribute('xml:base' => $base);
+    }
     $dom->setDocumentElement($root);
 }
 

Modified: trunk/libxml-rss-libxml-perl/t/1.0-parse.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/t/1.0-parse.t?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/t/1.0-parse.t (original)
+++ trunk/libxml-rss-libxml-perl/t/1.0-parse.t Wed Jun 23 16:20:27 2010
@@ -43,7 +43,7 @@
 </rdf:RDF>
 );
 
-plan tests => 8;
+plan tests => 9;
 
 use_ok("XML::RSS::LibXML");
 
@@ -57,6 +57,7 @@
        "eq",
        RSS_VERSION,
        "Is RSS version ".RSS_VERSION);
+is $xml->encoding, 'UTF-8', 'Encoding should be UTF-8';
 
 cmp_ok($xml->{namespaces}->{'#default'},
        "eq",

Modified: trunk/libxml-rss-libxml-perl/t/2.0-generate.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/t/2.0-generate.t?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/t/2.0-generate.t (original)
+++ trunk/libxml-rss-libxml-perl/t/2.0-generate.t Wed Jun 23 16:20:27 2010
@@ -1,6 +1,6 @@
 use strict;
 use File::Spec;
-use Test::More tests => 27;
+use Test::More tests => 29;
 
 BEGIN {
   use_ok("XML::RSS::LibXML");
@@ -30,7 +30,7 @@
 use constant RSS_ITEM_LINK  => "http://example.com/" . &POSIX::strftime( DATE_TEMPLATE_SHORT, gmtime ); # "$short_date";
 use constant RSS_ITEM_DESC  => "Yadda yadda yadda - R&D;";
 
-my $rss = XML::RSS::LibXML->new( version => RSS_VERSION );
+my $rss = XML::RSS::LibXML->new( version => RSS_VERSION, base => 'http://yow.com/' );
 isa_ok( $rss, "XML::RSS::LibXML" );
 
 is( $rss->{'version'}, RSS_VERSION, 'Version is ' . RSS_VERSION );
@@ -121,6 +121,8 @@
 
 cmp_ok( keys %{ $rss->{namespaces} }, ">=", 1,
        "RSS feed has at least one namespace");
+cmp_ok($rss->version, 'eq', RSS_VERSION, 'Should have the RSS version');
+cmp_ok($rss->base, 'eq', 'http://yow.com/', 'Should have the XML base');
 
 SKIP: {
     skip "TODO", 2;

Modified: trunk/libxml-rss-libxml-perl/t/2.0-parse.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/t/2.0-parse.t?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/t/2.0-parse.t (original)
+++ trunk/libxml-rss-libxml-perl/t/2.0-parse.t Wed Jun 23 16:20:27 2010
@@ -4,8 +4,8 @@
 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 version="2.0">
+use constant RSS_DOCUMENT      => qq(<?xml version="1.0" encoding="utf-8"?>
+<rss version="2.0" xml:base="http://foo.com/">
  <channel>
   <title>Example 2.0 Channel</title>
   <link>http://example.com/</link>
@@ -43,7 +43,7 @@
  </channel>
 </rss>);
 
-plan tests => 7;
+plan tests => 10;
 
 use_ok("XML::RSS::LibXML");
 
@@ -56,6 +56,9 @@
 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");
+cmp_ok($xml->version, 'eq', RSS_VERSION, 'Version attribute should be set');
+cmp_ok($xml->encoding, 'eq', 'utf-8', 'Encoding should be set');
+cmp_ok($xml->base, 'eq', 'http://foo.com/', 'Base attribute should be set');
 
 my $ok = 1;
 

Modified: trunk/libxml-rss-libxml-perl/t/generated/1.0-generated.xml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/t/generated/1.0-generated.xml?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/t/generated/1.0-generated.xml (original)
+++ trunk/libxml-rss-libxml-perl/t/generated/1.0-generated.xml Wed Jun 23 16:20:27 2010
@@ -3,18 +3,18 @@
   <channel rdf:about="http://example.com/">
     <link>http://example.com/</link>
     <description>To lead by example</description>
-    <dc:date>2010-06-03T01:47:38+0900</dc:date>
+    <dc:date>2010-06-22T01:00:35+0900</dc:date>
     <title>Test 1.0 Feed</title>
     <items>
       <rdf:Seq>
-        <rdf:li rdf:resource="http://example.com/2010/06/03"/>
+        <rdf:li rdf:resource="http://example.com/2010/06/22"/>
       </rdf:Seq>
     </items>
     <image rdf:resource="http://example.com/example.gif"/>
     <textinput rdf:resource="http://example.com/search.pl"/>
   </channel>
-  <item rdf:about="http://example.com/2010/06/03">
-    <link>http://example.com/2010/06/03</link>
+  <item rdf:about="http://example.com/2010/06/22">
+    <link>http://example.com/2010/06/22</link>
     <description>Yadda &amp; yadda &amp; yadda</description>
     <dc:creator>joeuser at example.com</dc:creator>
     <title>This is an item</title>

Modified: trunk/libxml-rss-libxml-perl/t/generated/2.0-generated.xml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/t/generated/2.0-generated.xml?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/t/generated/2.0-generated.xml (original)
+++ trunk/libxml-rss-libxml-perl/t/generated/2.0-generated.xml Wed Jun 23 16:20:27 2010
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<rss xmlns:my="http://purl.org/my/rss/module/" version="2.0">
+<rss xmlns:my="http://purl.org/my/rss/module/" version="2.0" xml:base="http://yow.com/">
   <channel>
     <ttl>60</ttl>
     <copyright>Copyright 2002</copyright>
@@ -10,20 +10,20 @@
     <link>http://example.com/</link>
     <language>en-us</language>
     <description/>
-    <lastBuildDate>2010-06-03T01:47:39+0900</lastBuildDate>
+    <lastBuildDate>2010-06-22T01:00:37+0900</lastBuildDate>
     <title>Test 2.0 Feed</title>
-    <pubDate>2010-06-03T01:47:39+0900</pubDate>
+    <pubDate>2010-06-22T01:00:37+0900</pubDate>
     <managingEditor>editor\@example.com</managingEditor>
     <item>
       <author>joeuser at example.com</author>
-      <comments>http://example.com/2010/06/03/comments.html</comments>
+      <comments>http://example.com/2010/06/22/comments.html</comments>
       <category>MyCategory</category>
-      <link>http://example.com/2010/06/03</link>
-      <enclosure>HASH(0x9ceb30)</enclosure>
+      <link>http://example.com/2010/06/22</link>
+      <enclosure>HASH(0x8faca0)</enclosure>
       <description>Yadda yadda yadda - R&amp;D;</description>
       <title>This is an item</title>
-      <pubDate>木  6/ 3 01:47:39 2010 GMT</pubDate>
-      <guid isPermaLink="true">http://example.com/2010/06/03</guid>
+      <pubDate>火  6/22 01:00:37 2010 GMT</pubDate>
+      <guid isPermaLink="true">http://example.com/2010/06/22</guid>
     </item>
     <image>
       <url>http://example.com/example.gif</url>

Modified: trunk/libxml-rss-libxml-perl/t/items-are-0.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/t/items-are-0.t?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/t/items-are-0.t (original)
+++ trunk/libxml-rss-libxml-perl/t/items-are-0.t Wed Jun 23 16:20:27 2010
@@ -1728,8 +1728,8 @@
     );
 
     # TEST
-    not_contains($rss, "<item>\n",
-        '2.0 - Item without description or title is skipped'
+    contains($rss, "<item>\n",
+        '2.0 - Item without description or title is included'
     );
 }
 

Modified: trunk/libxml-rss-libxml-perl/xt/pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/xt/pod-coverage.t?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/xt/pod-coverage.t (original)
+++ trunk/libxml-rss-libxml-perl/xt/pod-coverage.t Wed Jun 23 16:20:27 2010
@@ -1,12 +1,6 @@
+use strict;
 use Test::More;
-use strict;
+use Test::Requires 'Test::Pod::Coverage';
 
-if (! $ENV{TEST_POD}) {
-    plan skip_all => "Enable TEST_POD environment variable to test POD";
-} else {
-    eval "use Test::Pod::Coverage";
-    plan skip_all => "Test::Pod::Coverage required for testing pod coverage" if $@;
-
-    plan tests => 1;
-    Test::Pod::Coverage::pod_coverage_ok( "XML::RSS::LibXML", "XML::RSS::LibXML is covered" );
-}
+plan tests => 1;
+Test::Pod::Coverage::pod_coverage_ok( "XML::RSS::LibXML", "XML::RSS::LibXML is covered" );

Modified: trunk/libxml-rss-libxml-perl/xt/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libxml-rss-libxml-perl/xt/pod.t?rev=59765&op=diff
==============================================================================
--- trunk/libxml-rss-libxml-perl/xt/pod.t (original)
+++ trunk/libxml-rss-libxml-perl/xt/pod.t Wed Jun 23 16:20:27 2010
@@ -1,9 +1,4 @@
+use strict;
 use Test::More;
-use strict;
-if (! $ENV{TEST_POD}) {
-    plan skip_all => "Enable TEST_POD environment variable to test POD";
-} else {
-    eval "use Test::Pod 1.00";
-    plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
-    Test::Pod::all_pod_files_ok();
-}
+use Test::Requires 'Test::Pod';
+Test::Pod::all_pod_files_ok();




More information about the Pkg-perl-cvs-commits mailing list