Subject: | The add_contributor methods of by XML::Atom::Feed and XML::Atom::Entry do not add contributor elements |
When trying to add contributor tags to either an XML::Atom::Feed or
XML::Atom::Entry object, the add_contributor method adds an author
element if an XML::Atom::Person object is passed.
I would have expected a contributor element instead of an author element.
If add_contributor is called with a string, and empty contributor
element is added. I would not have tried this if the previous method had
not failed.
I have attached a short piece of code that demonstrates the problem by
creating basic Feed and Entry elements and executing the steps described
above.
Subject: | contrib_bug.pl |
#!/usr/bin/perl
#
use strict;
use warnings;
use XML::Atom::Feed;
use XML::Atom::Entry;
my $feed1 = XML::Atom::Feed->new();
$feed1->add_contributor( 'Wade' );
print "Feed: contributor as a string\n";
print $feed1->as_xml;
my $p = XML::Atom::Person->new();
$p->name( 'Wade' );
$p->email( 'wade@example.com' );
my $feed2 = XML::Atom::Feed->new();
$feed2->add_contributor( $p );
print "Feed: cntributor as an XML::Atom::Person\n";
print $feed2->as_xml;
my $entry1 = XML::Atom::Entry->new();
$entry1->add_contributor( 'Wade' );
print "Entry: contributor as a string\n";
print $entry1->as_xml;
my $p1 = XML::Atom::Person->new();
$p1->name( 'Wade' );
$p1->email( 'wade@example.com' );
my $entry2 = XML::Atom::Feed->new();
$entry2->add_contributor( $p );
print "Entry: contributor as an XML::Atom::Person\n";
print $entry2->as_xml;