Intento analizar un flujo XML rss. En realidad, se genera un error:Objeto de la clase DOMElement no se pudo convertir a la cadena
Catchable fatal error: Object of class DOMElement could not be converted to string in ...
que desea obtener el valor de "prueba" de la "relación" etiqueta
Aquí está mi código:
//check if url contents xml
$content = file_get_contents($flux);
$xml = new DOMDocument;
$xml->loadXML($content);
//get the link
$link = $xml->getElementsByTagName('link')->item(0);
echo $link;
Aquí es el flujo:
<?xml version="1.0" encoding="ISO-8859-15" ?>
<rss version="2.0">
<channel>
<title>test</title>
<link>http://test.fr</link>
</channel>
</rss>
¿Alguien me puede ayudar?
ayuda posible: http://stackoverflow.com/questions/548744/php-xpath-question – diEcho