php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49879 ERROR READING A LONG XML
Submitted: 2009-10-14 19:25 UTC Modified: 2009-10-15 17:33 UTC
From: bbarnett at gt dot co dot cr Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5.2.11 OS: WServer 2K3
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bbarnett at gt dot co dot cr
New email:
PHP Version: OS:

 

 [2009-10-14 19:25 UTC] bbarnett at gt dot co dot cr
Description:
------------
I have a long XML that I recieve from another system, but this XML has more than 30000 records (tag), and when I try to read it PHP can't do it.

If you need the XML data, I can send it to the e-mail that you send me.

Reproduce code:
---------------
$xml= simplexml_load_string(utf8_decode(trim($xmlrecieved)));
if (!$xml ){	
print 'MSG-20: Se detecto una respuesta invalida del INS '; die();
}

Expected result:
----------------
I need to process the data in the XML to update a database table.

Actual result:
--------------
PHP can't read it.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-15 13:30 UTC] phpwnd at gmail dot com
Post the XML file somewhere (pastebin for example) otherwise it's really hard to tell, especially if you don't receive an error message.
 [2009-10-15 14:08 UTC] bbarnett at gt dot co dot cr
I found a PHP script to view the xml error:
<?
$xml2= simplexml_load_string($xmlestilos);
if (!$xml2 ){
 $errors = libxml_get_errors();

    foreach ($errors as $error) {
        echo display_xml_error($error, $xml2).'<br>';
    }

    libxml_clear_errors();
    
}
?>
The error is: 
Fatal Error 9: Input is not proper UTF-8, indicate encoding ! Bytes: 0xA0 0x50 0x52 0x4F Line: 92244 Column: 24
 [2009-10-15 14:18 UTC] bbarnett at gt dot co dot cr
You can download the xml file from: 
https://201.199.26.154/xml/ins-estilos.txt

Thanks for your help
 [2009-10-15 14:29 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

That line (PITBULL <A0>PRO) contains the A0 character, which is not valid UTF-8. Either fix your XML, or set that you have the iso-8859-1 encoding. This is not a bug.
 [2009-10-15 17:33 UTC] bbarnett at gt dot co dot cr
I solved with the information that you bring me

Thank you much
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 13:01:30 2024 UTC