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

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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)';
 <?xml version="1.0" encoding="utf-8"?>
 <feed xmlns="http://www.w3.org/2005/Atom ">

  <title>Example Feed</title>
  <link href="http://example.org /"/>
   <name>John Doe</name>

   <title>Atom-Powered Robots Run Amok</title>
   <link href="http://example.org/2003/12/13/atom03 "/>
   <summary>Some text.</summary>


 $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

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?

On 01/20/2008 04:04 PM, RJ Newt wrote:
Quoted text here. Click to load it

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

Site Timeline