quiero abrir un XML y el simplexml_load_file no me va.
este es el archivo con el que estoy haciendo pruebas
Código
<?xml version='1.1' standalone='yes'?> <movies> <movie> <title>PHP: Behind the Parser</title> <characters> <character> <name>Ms. Coder</name> <actor>Onlivia Actora</actor> </character> <character> <name>Mr. Coder</name> <actor>El Act&#211;r</actor> </character> </characters> <plot> So, this language. It's like, a programming language. Or is it a scripting language? All is revealed in this thrilling horror spoof of a documentary. </plot> <rating type="thumbs">7</rating> <rating type="stars">5</rating> </movie> </movies>
y pruebo con este script para ver que pasa
Código
<?php // El fichero test.xml contiene un documento XML con el elemento raiz // y almenos un elemento /[root]/title. } else { } ?>
al ejecutar esto me da estos errores.
Citar
Warning: simplexml_load_file() [function.simplexml-load-file]: ejemplo.xml:2: parser error : XML declaration allowed only at the start of the document in C:\AppServ\www\experimentos2.php on line 6
Warning: simplexml_load_file() [function.simplexml-load-file]: <?xml version='1.1' standalone='yes'?> in C:\AppServ\www\experimentos2.php on line 6
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\AppServ\www\experimentos2.php on line 6
bool(false)
espero puedan ayudarme.
Thx
saludos.