have this code:
$products = $feed->_xpath->query( "//cf:vehicle" );
foreach( $products as $product )
{
echo $product->nodeName . ': ' . $product->getAttribute('code') . '<br />';
$imgs = $feed->_xpath->query( "//cf:image" , $product );
echo ' Imgs: ' . $imgs->length . '<br />';
}
the number of product nodes found in the xmlfeed is 103 - that is correct.
the query to locat images within that node however is NOT doing so within the current node context - it finds 116 image nodes which is the total number of image nodes within the feed where as it should only select the images within the current product (between 0 and 3 in most cases)
Any pointers muchly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…