I'm trying to filter my XML file for an element with a specific name. I've followed the instructions from here but the result is empty everytime.
XML
<vertalingen>
<kamers>
<kamer>
<naam>Bruidssuite</naam>
<beschrijving>Lorum Ipsum</beschrijving>
</kamer>
</kamers>
</vertalingen>
PHP
$xml = simplexml_load_file('translations/nederlands.xml');
$info = $xml->xpath('//kamer[naam="Bruidssuite"]');
echo " found {$info->naam}";
The code only returns "found"
The code gives the following PHP error:
PHP Notice: Trying to get property of non-object
I've also tried the following variations:
$info = $xml->xpath('/vertalingen/kamers/kamer[naam="Bruidssuite"]');
$info = $xml->xpath('/kamers/kamer[naam="Bruidssuite"]');