Ver Mensaje Individual
  #19 (permalink)  
Antiguo 17/06/2008, 20:15
sofway
 
Fecha de Ingreso: abril-2004
Mensajes: 154
Antigüedad: 20 años
Puntos: 0
Respuesta: Zend Framework consumiendo Web Service

Listo Gator, ya logre salir de los warnings y el var_dump si me retornó la info


Código:
object(SimpleXMLElement)#1 (7) { ["id"]=> string(57) "tag:api.eltiempo.com,2008:/eltiempo/articulos/CMS-4269823" ["title"]=> object(SimpleXMLElement)#2 (0) { } ["updated"]=> string(25) "2008-06-17T21:09:29-05:00" ["link"]=> array(2) { [0]=> object(SimpleXMLElement)#3 (1) { ["@attributes"]=> array(3) { ["href"]=> string(40) "/1.0/eltiempo/articulos/CMS-4269823.json" ["rel"]=> string(9) "alternate" ["type"]=> string(9) "text/json" } } [1]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(3) { ["href"]=> string(39) "/1.0/eltiempo/articulos/CMS-4269823.xml" ["rel"]=> string(9) "alternate" ["type"]=> string(20) "application/atom+xml" } } } ["summary"]=> object(SimpleXMLElement)#5 (0) { } ["category"]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(1) { ["term"]=> string(8) "Justicia" } } ["author"]=> object(SimpleXMLElement)#7 (1) { ["name"]=> string(24) "Casa Editorial El Tiempo" } }
Procedí entonces agregando las siguientes líneas

Código PHP:
$ns $xml->getNamespacestrue );
$xml->registerXPathNamespace('c'$ns['eltiempo']);
$title $xml->xpath('c:comentarios'); 

La idea es que quiero acceder a los comentarios, pero cuando verifico la variable $title, esto es lo que obtengo

array(0) { }
__________________
Desdichado quien duerme en la mañana