I have this XML:
<root> <parent> <child id="childAtt"> <subChild id="subAtt">Value to retrieve</subChild> </child> </parent> </root> I am currently trying to retrieve the text value of subChild using this XPath:
$total = $xml->xpath("/*//child[@id='childAtt']/subChild[@id='subAtt']"); However, this returns the subChild attribute value and not the node's text value.
I want to know how to retrieve the text value of subChild with the id of subAtt.