XML::Atom::Feed - parsing at all?

XML::Atom::Feed - parsing at all?

am 20.01.2008 23:04:25 von RJ Newt

I'm trying to parse up a feed but XML::Atom::Feed doesn't seem to
recognize that anything at all is in the XML string I'm feeding to
it. Here's a complete example of how it is not working:

#!/usr/bin/perl -w
use strict;
use XML::Atom::Feed;

# variables
my ($xml, $feed, @entries);

# feed example taken directly from RFC 4287
# see http://tools.ietf.org/html/rfc4287
$xml = <<'(RAW)';



Example Feed

2003-12-13T18:30:02Z

John Doe

urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6


Atom-Powered Robots Run Amok

urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a
2003-12-13T18:30:02Z

Some text.



(RAW)

$feed = XML::Atom::Feed->new(\$xml);
$feed or die $!;

@entries = $feed->entries();

print 'feed count: ', scalar(@entries), "\n";
print 'version: ', $feed->version, "\n";

Here's the output:
feed count: 0
version:

It appears to have no entries and no version. No errors are
displayed. Any ideas what I'm doing wrong?

Re: XML::Atom::Feed - parsing at all?

am 22.01.2008 07:25:06 von paduille.4061.mumia.w+nospam

On 01/20/2008 04:04 PM, RJ Newt wrote:
> I'm trying to parse up a feed but XML::Atom::Feed doesn't seem to
> recognize that anything at all is in the XML string I'm feeding to
> it. Here's a complete example of how it is not working:
> [...]
>
> print 'feed count: ', scalar(@entries), "\n";
> print 'version: ', $feed->version, "\n";
>
> Here's the output:
> feed count: 0
> version:
>

Your program works for me. Perhaps you don't have the right versions of
the modules that XML::Atom::Feed depends upon.