XML::RSS::Parser

XML::RSS::Parser is a liberal object-oriented parser for RSS feeds.
Download

XML::RSS::Parser Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Timothy Appnel
  • Publisher web site:
  • http://search.cpan.org/~tima/Text-Tiki-0.73/Tiki.pm

XML::RSS::Parser Tags


XML::RSS::Parser Description

XML::RSS::Parser is a liberal object-oriented parser for RSS feeds. XML::RSS::Parser is a liberal object-oriented parser for RSS feeds.SYNOPSIS #!/usr/bin/perl -w use strict; use XML::RSS::Parser; use FileHandle; my $p = XML::RSS::Parser->new; my $fh = FileHandle->new('/path/to/some/rss/file'); my $feed = $p->parse_file($fh); # output some values my $feed_title = $feed->query('/channel/title'); print $feed_title->text_content; my $count = $feed->item_count; print " ($count)n"; foreach my $i ( $feed->query('//item') ) { my $node = $i->query('title'); print ' '.$node->text_content; print "n"; }XML::RSS::Parser is a lightweight liberal parser of RSS feeds. This parser is "liberal" in that it does not demand compliance of a specific RSS version and will attempt to gracefully handle tags it does not expect or understand. The parser's only requirements is that the file is well-formed XML and remotely resembles RSS. Roughly speaking, well formed XML with a channel element as a direct sibling or the root tag and item elements etc.There are a number of advantages to using this module then just using a standard parser-tree combination. There are a number of different RSS formats in use today. In very subtle ways these formats are not entirely compatible from one to another. XML::RSS::Parser makes a couple assumptions to "normalize" the parse tree into a more consistent form. For instance, it forces channel and item into a parent-child relationship. For more detail see "SPECIAL PROCESSING NOTES".This module is leaner then XML::RSS -- the majority of code was for generating RSS files. It also provides a XPath-esque interface to the feed's tree.While XML::RSS::Parser creates a normalized parse tree, it still leaves the mapping of overlapping and alternate tags common in the RSS format space to the developer. For this look at the XML::RAI (RSS Abstraction Interface) package which provides an object-oriented layer to XML::RSS::Parser trees that transparently maps these various tags to one common interface.XML::RSS::Parser is based on XML::Elemental, a a SAX-based package for easily parsing XML documents into a more native and mostly object-oriented perl form. Requirements: · Perl


XML::RSS::Parser Related Software