isSimpleRSSElement and getElementText

Data from all simple RSS elements can be harvested using the getElementText method.

Take an element such as 'language', which is composed of a single child text node:


<language>en-us</language>

When the language element is processed by the code from the previous page ...


if ($parentElement->isSimpleRSSElement($currElementName)) { 
	echo $currElementName . ': ' . 
		$parentElement->getElementText($currElementName);
}

The following string is printed:

language: en-us

Another way of more directly achieving the same result is by using the hasElement method:


if ($parentElement->hasElement('language') && 
		$parentElement->isSimpleRSSElement('language')) {
	echo 'language: ' . $parentElement->getElementText('language');
}


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