if this code:
$s = 'BrowseNodes/BrowseNode';
$temp_bnid=$item->xpath($s);
echo '<pre>
Root Search:
';
print_r($temp_bnid);
echo '</pre>';
die('Halted for testing');
gives this output:
Root Search:
Array
(
[0] => SimpleXMLElement Object
(
[BrowseNodeId] => 2522032011
[Name] => Balls
[Ancestors] => SimpleXMLElement Object
(
[BrowseNode] => SimpleXMLElement Object
(
[BrowseNodeId] => 196601011
[Name] => Baby & Toddler Toys
[Ancestors] => SimpleXMLElement Object
(
[BrowseNode] => SimpleXMLElement Object
(
[BrowseNodeId] => 165795011
[Name] => Categories
[IsCategoryRoot] => 1
[Ancestors] => SimpleXMLElement Object
(
[BrowseNode] => SimpleXMLElement Object
(
[BrowseNodeId] => 165793011
[Name] => Toys & Games
)
)
)
)
)
)
)
)
Halted for testing
and this code:
$s = 'BrowseNodes/BrowseNode[Name=Categories]';
// I also tried $s = 'BrowseNodes/BrowseNode[Name="Categories"]';
$temp_bnid=$item->xpath($s);
echo '<pre>
Root Search:
';
print_r($temp_bnid);
echo '</pre>';
die('Halted for testing');
gives this output:
Root Search:
Array
(
)
Halted for testing
What am I doing wrong, when I am trying to get the BrowseNode node that contains the "Name" node where the "Name" node value is "Categories"? An alternate solution for this issue would be to select the node on the existence of the "IsCategoryRoot" node, but I really want to learn how to do the other query as it might help me more in the future. Niether way worked with the queries I treid.
BrowseNodes/BrowseNode[@Name="Categories"].