Hey,

I am trying to add an  <item> with <dc:creator>:
<item>
    <title>item title>
    <link>http://example.com/1</link>
   * <dc:creator>sam</dc:creator>*
</item>


Here is perl code:
=8<=
use strict;
use warnings;
use XML::RSS;
my $rss = XML::RSS->new(version => '*2.0*');
$rss->add_module(prefix => 'dc', uri => 'http://purl.org/dc/elements/1.1/');
$rss->channel(title => 'title', link => 'http://exmaple.com', description
=> 'description');
$rss->add_item(title => 'item title', link => 'http://example.com/1',
    dc => {creator => 'sam'}
    );
print $rss->as_string;
=8<=

It doesn't add <dc:creator> element.
<item>
<title>item title</title>
<link>http://example.com/1</link>
</item>


When I use the following:
=8<=
use strict;
use warnings;
use XML::RSS;
my $rss = XML::RSS->new(version => '2.0');
$rss->add_module(*prefix => 'ddc'*, uri => '
http://purl.org/dc/elements/1.1/');
$rss->channel(title => 'title', link => 'http://exmaple.com', description
=> 'description');
$rss->add_item(title => 'item title', link => 'http://example.com/1',
    *ddc => *{creator => 'sam'}
    );
print $rss->as_string;
=8<=


It does give me
<item>
<title>item title</title>
<link>http://example.com/1</link>
*<ddc:creator>sam</ddc:creator>*
</item>



How can I include <dc:creator>  in RSS 2.0 document?

Thanks.
Sam

Reply via email to