I'm using this code to extract all required nodes from xml:
$xml = simplexml_load_file('file.xml');
echo "<strong>Using direct method...</strong><br />";
$items = $xml->xpath('/w:document/w:body/w:tbl/w:tr/w:tc/w:p/w:r/w:t');
foreach($items as $item) {
echo "Found $item<br />";
}
I'm getting a long list of entries, but I need possibility to choose any of them seperately. tried to use echo "Found $item[2]<br />";
but got error:
Warning: main() [function.main]: Cannot add element t number 1 when only 0 such elements exist
thanks for advices