Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/11/2013, 03:44
charlyta
 
Fecha de Ingreso: junio-2008
Mensajes: 291
Antigüedad: 15 años, 10 meses
Puntos: 9
Problema llamando a xml

Hola. Estoy haciendo una llamada a un xml remoto. La cosa es que funciona cuando no asigno un $id en php en el link y si no asigno a una variable php el nodo xml.
Por ejemplo, Así funciona correctamente:


Código PHP:
$what 'ResourceLink';
$reader = new XMLReader();
$reader->open('http://file.xml/getRecordsX.do?user=usuario&password=pass=978841580114-6&metadataformat=ONIX&version=3.0');
while (
$reader->read()) {
    if (
$reader->nodeType == XMLReader::ELEMENT) {
        
$exp $reader->expand();
        if (
$exp->nodeName == $what)
           echo 
'<img src="' $exp->nodeValue .' " height="15%" width="15%" />';
            
    }


de este modo, no me muestra nada:

Código PHP:
$id "978841580114-6";
$what 'ResourceLink';
$reader = new XMLReader();
$reader->open('http://file.xml/getRecordsX.do?user=usuario&password=pass&identifier=$id&metadataformat=ONIX&version=3.0');
while (
$reader->read()) {
    if (
$reader->nodeType == XMLReader::ELEMENT) {
        
$exp $reader->expand();
        if (
$exp->nodeName == $what)
            
//echo '<img src="' . $exp->nodeValue .' " height="15%" width="15%" />';
            
$img $exp->nodeValue;
            print  
$img;
    }


Hay alguna manera de asigna a una variable php el $exp->nodeValue?

Última edición por charlyta; 09/11/2013 a las 03:50 Razón: correccion