Subject: | Information lost in convert process |
There seems to be a problem in the conversion from RSS to Atom. The
attached test demonstrates it. In the original RSS feed, the entry
contains HTML formatting. When I convert the feed to Atom that
formatting vanishes.
Let me know if you need any more details.
Subject: | rss.xml |
<?xml version="1.0" encoding="ISO-8859-1"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
>
<channel rdf:about="http://use.perl.org/~davorg/journal/">
<title>davorg's Journal</title>
<link>http://use.perl.org/~davorg/journal/</link>
<description>davorg's use Perl Journal</description>
<dc:language>en-us</dc:language>
<dc:rights>use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners.</dc:rights>
<dc:date>2009-04-09T12:53:36+00:00</dc:date>
<dc:publisher>pudge</dc:publisher>
<dc:creator>pudge@perl.org</dc:creator>
<dc:subject>Technology</dc:subject>
<syn:updatePeriod>hourly</syn:updatePeriod>
<syn:updateFrequency>1</syn:updateFrequency>
<syn:updateBase>1970-01-01T00:00+00:00</syn:updateBase>
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://use.perl.org/~davorg/journal/38730?from=rss" />
</rdf:Seq>
</items>
<image rdf:resource="http://use.perl.org/images/topics/useperl.gif" />
</channel>
<image rdf:about="http://use.perl.org/images/topics/useperl.gif">
<title>davorg's Journal</title>
<url>http://use.perl.org/images/topics/useperl.gif</url>
<link>http://use.perl.org/~davorg/journal/</link>
</image>
<item rdf:about="http://use.perl.org/~davorg/journal/38730?from=rss">
<title>Task::Kensho RPMs</title>
<link>http://use.perl.org/~davorg/journal/38730?from=rss</link>
<description><p>One of the first concrete outputs from the <a href="http://www.enlightenedperl.org/">Enlightened Perl Organisation</a> has been <a href="http://search.cpan.org/dist/Task-Kensho/">Task::Kensho</a> - a CPAN module which exists to list a number of other CPAN modules that modern Perl programmers should consider using. if you install Task::Kensho then all of the included modules will automatically be pulled down from CPAN and installed.</p><p>I don't install my modules from CPAN. As I live in the Red Hat world, I like to install RPMs of modules. And I build RPMs for modules that aren't already available in that format (and then I <a href="http://rpm.mag-sol.com/">make them available to everyone</a>).</p><p>So last night I created an RPM for Task::Kensho. This also involved building RPMs for about half of the modules it include which didn't already exist as RPMs in the standard repostories. Those RPMs are now available from <a href="http://rpm.mag-sol.com/">my repository</a> so installing them all could be as simple as <tt>sudo yum install perl-Task-Kensho</tt>. Of course, you can also install individual packages using the appropriate <tt>yum</tt> command.</p><p>Currently the RPMs are only available for Fedora 10. I'll build versions for Centos 5 over the next couple of days.</p></description>
<dc:creator>davorg</dc:creator>
<dc:date>2009-03-31T08:02:06+00:00</dc:date>
<dc:subject>journal</dc:subject>
</item>
</rdf:RDF>
Subject: | convert.t |
use Test::More 'no_plan';
use XML::Feed;
my $rss = XML::Feed->parse('rss.xml');
isa_ok($rss, 'XML::Feed::Format::RSS');
my $rss_entry = ($rss->entries)[0];
isa_ok($rss_entry, 'XML::Feed::Entry::Format::RSS');
my $rss_content = $rss_entry->content;
isa_ok($rss_content, 'XML::Feed::Content');
is($rss_content->type, 'text/html', 'Correct content type');
like($rss_content->body, qr(<|<), 'Contains HTML tags');
my $atom = $rss->convert('Atom');
isa_ok($atom, 'XML::Feed::Format::Atom');
my $atom_entry = ($atom->entries)[0];
isa_ok($atom_entry, 'XML::Feed::Entry::Format::Atom');
my $atom_content = $atom_entry->content;
isa_ok($atom_content, 'XML::Feed::Content');
is($atom_content->type, 'text/html', 'Correct content type');
like($atom_content->body, qr(<|<), 'Contains HTML tags');