Is there anyway using XMLReader (or SimpleXML for that matter) where I can search for all nodes with a particular name, rather than having to process through them each? At the moment I’m having to do:
$xml = "URI/to/XML/file";
$reader = new XMLReader;
$reader->open($xml);
$reader->open($xml);
while ($reader->read()) {
if ($reader->nodeType == XMLREADER::ELEMENT && $reader->localName == 'ResultCode') {
print "Found it!";
break;
}
}
$reader->close();
Of course. Was just looking at DOMDocument last week. I’ll see how it performs in relation, though I’m quite pleased with the performance of the SimpleXMLElement version