XML::RAI

RSS Abstraction Interface
Download

XML::RAI Ranking & Summary

Advertisement

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

XML::RAI Tags


XML::RAI Description

RSS Abstraction Interface XML::RAI (the RSS Abstraction Interface, or RAI (said "ray")) provides an object-oriented interface to XML::RSS::Parser trees that abstracts the user from handling namespaces, overlapping and alternate tag mappings.It's rather well known that, while popular, the RSS syntax is a bit of a mess. Anyone who has attempted to write software that consumes RSS feeds "in the wild" can attest to the headaches in handling the many formats and interpretations that are in use. For instance, in "The myth of RSS compatibility" http://diveintomark.org/archives/2004/02/04/incompatible-rss Mark Pilgrim identifies 9 different versions of RSS (there are 10 actually) and that is not without going into tags with overlapping purposes. Even the acronym RSS has multiple though similar meanings.The XML::RSS::Parser alone attempts to help developers cope with these issues through a liberal interpretation of what is RSS and routines to normalize the parse tree into a more common and manageable form.RAI takes this one step further. Its intent is to give a developer the means to not have to care about what tags the feed uses to present its meta data.RAI provides a single simplified interface that maps one method call to various overlapping and alternate tags used in RSS feeds. The interface also abstracts developers from needing to deal with namespaces. Method names are based on Dublin Core terminology.With the release of version 1.0, the XML::RSS::Parser distribution was folded into XML::RAI. When initially released, RSS 2.0 had a namespace. When it was reported a few days later that some XSLT-based systems were breaking because of the change in the RSS namespace from "" (none) to http://backend.userland.com/rss2, the namespace was removed, but the version number was not incremented making it incompatible with itself. http://groups.yahoo.com/group/rss-dev/message/4113 This version was not counted in Mark's post.SYNOPSIS #!/usr/bin/perl -w use strict; use XML::RAI; my $doc = < < rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/" > < channel > < title >tima thinking outloud < link >http://www.timaoutloud.org/ < description > < dc:language >en-us < item > < title >His and Hers Weblogs. < description >First it was his and hers Powerbooks. Now its weblogs. There goes the neighborhood. < link >http://www.timaoutloud.org/archives/000338.html < dc:subject >Musings < dc:creator >tima < dc:date >2004-01-23T12:33:22-05:00 < /item > < item > < title >Commercial Music Again. < description >Last year I made a post about music used in TV commercials that I recognized and have been listening to. For all the posts I made about technology and other bits of sagely wisdom the one on commercial music got the most traffic of any each month. I need a new top post. Here are some more tunes that have appeared in commercials. < guid isPermaLink="true" > http://www.timaoutloud.org/archives/000337.html < /guid > < category >Musings < author >tima < pubDate >Sun, 18 Jan 2004 14:09:03 GMT < /item > < /channel > < /rss > DOC # The above is to demonstrate the value of RAI. It is not any # specific RSS format, nor does it exercise best practices. my $rai = XML::RAI- >parse_string($doc); print $rai- >channel- >title."\n\n"; foreach my $item ( @{$rai- >items} ) { print $item- >title."\n"; print $item- >link."\n"; print $item- >content."\n"; print $item- >issued."\n\n"; } Requirements: · Perl


XML::RAI Related Software