Subject: | guid default isPermaLink=true |
Date: | Sat, 30 Jan 2010 08:15:38 +1100 |
To: | bug-XML-RSS [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With XML::RSS 1.47 and recent debian i386 perl 5.10.1 the program below
prints "no permalink" where I expected it to print
"http://foo.com/page.html".
If I'm not mistaken the rss 2.0 spec is for a default isPermaLink=true
if it's omitted from a <guid>, and I believe that's how XML::RSS::LibXML
operates.
#!/usr/bin/perl
use strict;
use warnings;
use XML::RSS;
my $xml = <<'HERE';
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<item>
<title>Item One</title>
<guid>http://foo.com/page.html</guid>
</item>
</channel>
</rss>
HERE
my $feed = XML::RSS->new;
$feed->parse($xml);
print $feed->{'items'}->[0]->{'permaLink'} || 'no permaLink', "\n";