Hello ,

I am trying to parse a valid xml document using XML::RAI and see that it can identify limited number of fields that i can retrieve. How can i retrieve author or description or replycount fields from the XML document given below.

#!/usr/bin/perl use XML::RAI; my $xml=`curl -ksS "https://forums.com/rss.php?forumID=143"`; $xml =~ s/\15//g; my $feed = XML::RAI->parse($xml); for ( reverse (@{$feed->items}) ){ my $title=$_->title; my $date =$_->created ; my $date_modified; my $url =$_->link ; }

XML Format:

<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:jf="http://forums.com/rss"> <channel> <item> <title>xxxxxxxxxxxxxxxxx</title> <link>https://forums.com/thread.php</link> <description>yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy</description> <pubDate>Wed, 19 Sep 2012 20:57:16</pubDate> <jf:creationDate>Wed, 19 Sep 2012 20:57:16 </jf:creationDate> <jf:modificationDate>Wed, 19Sep2012 20:57:16 </jf:modification +Date> <jf:date>Sep 19, 2012</jf:date> <jf:author>author1</jf:author> <jf:replyCount>3</jf:replyCount> </item> </channel> </rss>

In reply to XML Parser question by idcrisis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.