A DOMIT! RSS document will allow you to extract data from a wider range of elements than does DOMIT! RSS Lite. This includes not only optional RSS elements such as 'language' or 'copyright', but also user defined RSS elements such as the Dublin Core.
Two DOMIT! RSS methods enable you to query any channel, item (or any other type of RSS defined element) for the existence of additional elements.
hasElement
The hasElement method tests for the existence of a single named element. You pass as a parameter the name of the element whose existence you are testing for, and either true or false are returned:
$doesCopyrightExist = $currentChannel->hasElement('copyright');
getElementList
The getElementList method returns an array of names of all elements that exist under a element:
print_r ($currentChannel->getElementList());
/* returns something like ...
Array
(
[0] => title
[1] => link
[2] => description
[3] => language
[4] => copyright
[5] => docs
[6] => managingeditor
[7] => webmaster
[8] => domit_rss_items
[9] => domit_rss_categories
)
*/
|