Hi I'm struggling to get to the child nodes within a parent with a specific attribute. I want to do this
$word=$xml->xpath("//page[@name='$page']")->word; but can't.
where $page is 'the xml file has the format
Any tips would be appreciated
$word=$xml->xpath("//page[@name='$page']")->word; but can't.
where $page is 'the xml file has the format
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keywords>
<page name="[URL unfurl="true"]http://www.domain.co.uk">[/URL]
<word frequency="1">hello</word>
<word frequency="2">world</word>
</page>
<page name="[URL unfurl="true"]http://www.domain.co.uk/contact.php">[/URL]
<word frequency="1">hello</word>
<word frequency="2">world</word>
</page>
</keywords>