Iterating through the channel elements

Iterating through the channels of an RSS document is easy with DOMIT! RSS or DOMIT! RSS Lite.

You first instantiate a document and determine how many channels exist (note that in the next several sections we will use DOMIT! RSS Lite for examples. The additional DOMIT! RSS functionality will be discussed afterwards):


require_once('somepath/xml_domit_rss_lite.php');
$rssdoc =& new xml_domit_rss_document_lite('http://www.somesite.com/rss.xml', 
								'./', 3600);
$numChannels = $rssdoc->getChannelCount();

You then set up a for statement to loop through the series of channels and get a reference to each.


for ($i = 0; $i < $numChannels; $i++) {
	$currentChannel =& $rssdoc->getChannel($i);
	//process channel elements
}


Documentation generated by ClassyDoc, using the DOMIT! and SAXY parsers.
Please visit Engage Interactive to download free copies.