Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/11/2011, 08:19
kaiser_amrod
 
Fecha de Ingreso: noviembre-2011
Mensajes: 11
Antigüedad: 12 años, 5 meses
Puntos: 0
Pregunta problema para cargar namespace con simplexml

hola, soy nuevo en este foro. tengo un problema al cargar un xml el cual contiene por obligacion 3 direcciones web en el namespace. no se si sera por eso o simplemente porque la libreria no es compatible. La pagina web me carga el dato que necesito, pero me lanza 3 warning, pero no he podido encontrar porque falla.

<assertion xsi:schemaLocation="http://www.imsglobal.org/xsd/imsassert_v1p0 http://www.imsglobal.org/xsd/imsassert_v1p0.xsd http://www.imsglobal.org/xsd/imslip_v1p0 http://www.imsglobal.org/xsd/imslip_v1p0.xsd">
<lip:contentype>
<lip:referential>
<lip:indexid>assertion_01</lip:indexid>
</lip:referential>
</lip:contentype>
<assertion>

el dato que esta en negrita es el que quiero rescatar, el cual lo hace, pero me lanza el siguiente warning:

Warning: simplexml_load_file() [function.simplexml-load-file]: C:/AppServ/www/boxedtype/temp/9531/reflexion.xml:2: parser warning : xmlns:lip: 'http://www.imsglobal.org/xsd/imsreflex_v1p0 http://www.imsglobal.org/xsd/imsreflex_v1p0.xsd http://www.imsglobal.org/xsd/imslip_v1p0 http://www.imsglobal.org/xsd/imslip_v1p0.xsd ' is not a valid URI in C:\AppServ\www\boxedtype\metadatos.php on line 11

Warning: simplexml_load_file() [function.simplexml-load-file]: www.imsglobal.org/xsd/imslip_v1p0 http://www.imsglobal.org/xsd/imslip_v1p0.xsd " in C:\AppServ\www\boxedtype\metadatos.php on line 11

Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\AppServ\www\boxedtype\metadatos.php on line 11


aqui les dejo el codigo que utilice para recorrer el xml:

Código PHP:
$xml simplexml_load_file($ruta."/assertion.xml");
     
     
$ns =  $xml->getNamespaces(true);
     
$xml->registerXPathNamespace('c',$ns['lip']);
     
$contentype $xml->xpath('//c:indexid');
     echo 
$contentype[0]; 
saludos y muchas gracias de antemano. ojala puedan ayudarme.