From:
Operating system: W2K3
PHP version: 5.2.14
Package: DOM XML related
Bug Type: Bug
Bug description:Invalid Nodetype to import
Description:
------------
While I'm trying to import an extensive xml, I'm recieving the same error
while I
try to transale to simple xml.
Test script:
---------------
libxml_use_internal_errors(true);
$xmlestilos=ereg_replace(chr(160),"",(trim($reg[0])));
$xmlestilos=ereg_replace('"',"",$xmlestilos);
$xmlestilos=ereg_replace(",",".",$xmlestilos);
$xmlestilos=ereg_replace("&","",$xmlestilos);
$xmlestilos=ereg_replace(">","",$xmlestilos);
$xmlestilos=ereg_replace("}","",$xmlestilos);
$xmlestilos=ereg_replace("#","",$xmlestilos);
$xmlestilos=ereg_replace("`","",$xmlestilos);
$xmlestilos=ereg_replace(";","",$xmlestilos);
$xmlestilos=ereg_replace("[\\|]+","",$xmlestilos);
$xmlestilos=ereg_replace("[\\]+","/",$xmlestilos);
$xmlestilos=ereg_replace("¦","",($xmlestilos));
$xmlestilos=ereg_replace("º","",($xmlestilos));
$xmlestilos=ereg_replace("´","",($xmlestilos));
$xmlestilos=ereg_replace("¨","",($xmlestilos));
$xmlestilos=ereg_replace("[\\?]+","",($xmlestilos));
$xmlestilos=ereg_replace("[\\¿]+","",($xmlestilos));
$xmlestilos=acentos($xmlestilos);
$xmlestilos=stripslashes($xmlestilos);
$xmlestilos=utf8_decode($xmlestilos);
$dom = new domDocument;
$dom->loadXML($xmlestilos);
if (!$dom) {
//Escribe la respuesta en un archivo
$formato1 = '%d%m%Y'; $hoyes = strftime($formato1);
$archivolog="estilos_".$hoyes.".log";
if (file_exists($archivolog)){unlink($archivolog);}
$fp = fopen ($archivolog, "a");
//fwrite ($fp, trim($reg[0]). PHP_EOL);
fwrite ($fp, trim($xmlestilos). PHP_EOL);
fclose($fp);
print 'MSG-18: SE DETECTO UNA RESPUESTA INVALIDA DEL INS'; die();
}
$xml = simplexml_import_dom($dom);
Expected result:
----------------
The xml imported in a simple xml object
Actual result:
--------------
Warning: simplexml_import_dom() [function.simplexml-import-dom]: Invalid
Nodetype
to import in E:\SITIOS\PayWebCoopemex\INS\ins-405.srv.php on line 149
--
Edit bug report at http://bugs.php.net/bug.php?id=53044&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53044&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53044&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53044&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53044&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53044&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53044&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53044&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53044&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53044&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53044&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53044&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53044&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53044&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53044&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53044&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53044&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53044&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53044&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53044&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53044&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53044&r=mysqlcfg