Here's some code I am currently using. Where I need help are $bn_name_search and $bn_id_search
$xpath_base='/ItemSearchResponse/Items/Item[';
for ($i = 1; $i<=10; $i++)
{
$curr_item_base=$xpath_base.$i.']';
$bn_name_search=$curr_item_base.'/BrowseNodes//BrowseNode/Name/text()';
$bn_id_search=$curr_item_base.'/BrowseNodes//BrowseNode/BrowseNodeId/text()';
$bn_names=$parsed->xpath($bn_name_search);
$bn_ids=$parsed->xpath($bn_id_search);
}
This gives me all the browsnode names and all the broswnode ids. What I'd like to do now is find only the browsenode names "BrowseNode/Name/" that are not "All Products" and only browsnode ids "BrowseNode/BrowseNodeId/" share a "BrowseNode/" with a name that is not "All Departments" I don't have to test for the existance of BrowseNode/Name. It won't be blank if there is an ID. If I can put two negative expressions it would be even better. I would omit those whose names are "All Products" and those whose names are "Departments"
I did not post my XML because it is huge, but if you need to see it, let me know an I'll edit the question.
No comments:
Post a Comment