I have an xml file generated by my web service, I now want to display some information from the xml
all tags in the xml are in the same level, there is no hierarchy.
However, I have these tags on either side of the document, namely:
<xml version="1.0" encoding="ISO-8859-1"><xmlresponse>
And:
</xmlresponse></xml>
afin d'utiliser une balise et de l'afficher j'ai donc le code suivant:
<?php
$document_xml = new DomDocument();
$resultat_html = '';
$document_xml->load('tmp/'.$_GET['n_doss'].'.xml');
//echo $elements = $document_xml->getElementsByTagName('rating');
$title = $document_xml->xpath('rating');
echo trim($title[0]);
?>
However, I am forwarding an error message saying:
Fatal error: Call to undefined method DOMDocument :: xpath ()
I do not know how to solve it.
Thank you in advance for your help.