Hello,
I am trying to list multiple siblings of CategoryParentName. The siblings can be a min of 2 to all the way till 7. Any help is appreciated. Refer to code below.
Topher
Code:
//get the nodes needed
$catCount = $responseDoc->get_elements_by_tagname('CategoryCount');
$suggestedCategories = $responseDoc->get_elements_by_tagname('SuggestedCategory');
//display title and number of categories returned
echo '<P><B>Suggested Categories - ', $catCount[0]->get_content(), '</B>';
//go through each suggested category
foreach($suggestedCategories as $cat)
{
//get SuggestedCategory details
$catName = $cat->get_elements_by_tagname('CategoryName');
$catId = $cat->get_elements_by_tagname('CategoryID');
$percentItems = $cat->get_elements_by_tagname('PercentItemFound');
$catParent = $cat->get_elements_by_tagname('CategoryParentName');
//display suggested category
echo '<BR>', $catParent[0]->get_content(), ', ', $catName[0]->get_content(), ' (', $catId[0]->get_content(), ') - ', $percentItems[0]->get_content(), '% of items';
}
}