I have a xml file with nodes and attributes
<hotspot name="hs1"/>
<hotspot name="hs2"/>
<hotspot name="hs3"/>
I would like to check if the nodc hotspot exist and if a specific attribute value exist. I'm trying this but id doesn't work...
<?php
$file = 'hotspots.xml';
$xml = simplexml_load_file($file);
$var = $xml->xpath("//hotspot[@name='hs2']");
if (isset($var)) { echo 'does exist' } else {echo 'does not exist'}
?>
Well, it doesn't work at all (error 500) Sorry for being such a newbee, help much appreciated ! THX !