Ver Mensaje Individual
  #5 (permalink)  
Antiguo 22/03/2012, 13:47
Avatar de syntex
syntex
 
Fecha de Ingreso: noviembre-2002
Ubicación: Cataluña
Mensajes: 978
Antigüedad: 21 años, 5 meses
Puntos: 4
Respuesta: Consulta de archivo XML

Introduciendo este script:

$ruta_PartNumber = "http://xxx:[email protected]/xml_s3/xml_server3.cgi?prod_id=".trim(strtolower($PartNum ber)).";vendor=".trim(strtolower($Marca)).";lang=E S;output=metaxml";
$sxe = new SimpleXMLElement($xml);

foreach ($sxe->{'files.index'}->file->attributes() as $c => $v) {
echo "$c => $v <br />";
}

Me tira este error:

Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 1: parser error : Start tag expected, '<' not found in xxxxxx
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: http://
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: ^ in C:
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in C:

Con "simplexml_load_file($ruta_PartNumber)", no se podria leer el atributo?
__________________
------------------------------------------------
La paciencia es el rey de la ciencia
------------------------------------------------