Template::Plugin::XML::Feed - Plugin interface to XML::Feed
[% USE news = XML.Feed('news.rdf') %] [% FOREACH item IN news.items %] [% item.title %] [% item.link %] [% END %]
This Template Toolkit plugin provides a simple interface to the XML::Feed module.
[% USE news = XML.Feed('mysite.rdf') %]
It creates an XML::Feed object, which is then used to parse the RSS or Atom file specified as a parameter in the USE directive. A reference to the XML::Feed object is then returned.
The attributes of the channel and image elements can be retrieved directly from the plugin object using the familiar dotted compound notation:
[% news.channel.title %] [% news.channel.link %] [% news.channel.etc... %] [% news.image.title %] [% news.image.url %] [% news.image.link %] [% news.image.etc... %]
The list of news items can be retrieved using the 'items' method:
[% FOREACH item IN news.items %] [% item.title %] [% item.link %] [% END %]
Constructor method. Delegates to XML::Feed->parse to create an XML::Feed object. Not usually called directly.
This plugin was written by Dave Cross and was heavily based on the code for Template::Plugin::XML::RSS by Andy Wardley.
The XML::Feed module, which implements all of the functionality that this plugin delegates to, was written by Benjamin Trott and is now maintained by Dave Cross.
Copyright (C) 2009-2020 Magnum Solutions Ltd. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Template::Plugin, XML::Feed
To install Template::Plugin::XML::Feed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::XML::Feed
CPAN shell
perl -MCPAN -e shell install Template::Plugin::XML::Feed
For more information on module installation, please visit the detailed CPAN module installation guide.