Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/04/2011, 13:47
duraznero
 
Fecha de Ingreso: abril-2011
Ubicación: chile
Mensajes: 16
Antigüedad: 13 años, 1 mes
Puntos: 0
Pregunta error con XML en php !!!

Hola estoy cargando un xml, con una pagina simple en php y desplegando algunos datos de este archivo, (XML) el problema se presenta cuando intento cargar un archivo que ya esta creado me arroja el siguiente error:

Warning: DOMDocument::load(): I/O warning : failed to load external entity "/var/www/pedro.xml" in /var/www/2.php on line 18

alguien sabe como solucionar esto, lei por ahi que es un bug de php pero no puedo repararlo, adjunto mi codigo con el cual estoy leyendo el archivo XML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
//estructura de la carga de un XML::


$archivo = $_POST["as"];
$doc_xml = new DOMDocument();
$doc_xml->load($archivo);


$res_cor = $doc_xml->getElementsByTagName( "choiceInteraction" );
$res_dat = $doc_xml->getElementsByTagName( "correctResponse" );

foreach ($res_cor as $aux)
{
$preg = $aux->getElementsByTagName( "prompt" );
$tit_preg= $preg->item(0)->nodeValue;

$tor2 = $aux->getElementsByTagName( "simpleChoice" );
$num = $tor2->length;

echo "$tit_preg <br>";
$aux2=0;

while ($num > 0 ){

$num --;
$temp = $tor2->item($aux2)->nodeValue;
echo '<input value="1" name="radio2" type="radio"/>';
echo "$temp \r <br> ";
echo "\r";
$aux2++;
}

}



?>

</body>
</html>


----------------------------------------------------------------------------------------------------------------------------------

aclaración: donde esta la variable $archivo esta la selecciono por medio de un filetype con el siguiente codigo:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Carga Pregunta.</title>
</head>
<body>
<form action="2.php" Method="post">
<p>
Seleccionar Pregunta a cargar:<br><br>

</p>
<br>
<input type="file" name="as" size="55"> <br> <br> <br>
<input type="submit" class="boton" value="Ingresar"> <br><br><br>


</form><br>

</body>
</html>

---------------------------------------------------------------------------------------------------------------------------------- ocupo debian 6.0 y PHP Version 5.3.3-7+squeeze1 gracias por alguna sugerencia...