I have a question regarding the processing of an XML file using DomDocument in PHP.
<managedObject class="class1" version="version1" distName="distName1" id="id1">
<p name="a">Data I have</p>
<p name="b">Some data</p>
<p name="c">Some data</p>
<p name="d">Data I need</p>
<p name="e">Some data</p>
</managedObject>
<managedObject class="class2" version="version2" distName="distName2" id="id2">
<p name="a">Some data</p>
<p name="b">Some data</p>
<p name="c">Some data</p>
<p name="d">Some data</p>
<p name="e">Some data</p>
</managedObject>
By only knowing the "a" element, could I get the "d" element, but only if the parent have a certain class and version?
So far I've had a few tries, most recent being:
$nodes = $finder->query("//*[contains(@class, 'class1')][contains(@version, 'version1')]/*[contains(@name, 'a')]");
foreach ($nodes as $node) {
$Array[$i] = $node;
}
I used this to see at least some properties of the node but it doesn't return anything.
Any help would be appreciated.