Xml2Rss is a helper class for easy RSS generation from an existing XML
This class is an easy to use, simple XML to RSS generator. You can automatically convert your XML feed (or XML file) to a valid RSS 2.0 feed, with only a few required parameters.
Advanved features include setting of optional RSS feed fields, custom description HTML output, including images in the feed etc
Example: Simple generation
This example shows a minimum setting for the XML to RSS generation. You only need to set up the elemetnts, which are required by the RSS 2.0 standard
<?php $x = new XmlToRss(); $x->url('example.xml') ->title('Rss test') ->description('Some RSS description') ->autoConvert(array( 'description' => 'field1', 'link' => 'field2', 'title' => 'field3', 'pubDate'=>'field4', 'guid'=>'field5', )); ?>
To start generating, just 3 simple steps are needed.
<?php require_once("Xml2Rss.class.php"); ?>
<? $x = new XmlToRss(); ?>
<? $x->url('example.xml'); $x->title('Rss test'); $x->description('Some RSS description'); $x->map(array( 'description' => 'field1', 'link' => 'field2', 'title' => 'field3', 'pubDate'=>'field4', 'guid'=>'field5', )); $x->autoConvert(); ?>
As this class is an extension to the Xml2Csv class, so if you need some advanced ways of using it, please refer to the documentation of the Xml2Csv class
Here you can find the complete reference of properties and functions:
If you want to see the converter in action, check out the live demo:
http://praca.webax.sk/xml2rss/torss.php