|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-21 12:31 UTC] rrichards@php.net
[2008-10-27 07:18 UTC] nodkz at mail dot ru
[2008-11-11 05:45 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 14:00:01 2025 UTC |
Description: ------------ $data="id=&bill%5Bcustomer_id%5D=1"; $myArray = readXml($data); echo "Ok, go on working!!!"; // <-- But it would not function readXml($data) { $reader=new XMLReader(); libxml_use_internal_errors(true); if(!$reader->XML($data, 'UTF-8', LIBXML_NOERROR|LIBXML_ERR_NONE|LIBXML_NOWARNING)) { return null; } while($reader->read()) { // <--- ERROR HERE!!!! (XMLReader::read(): An Error Occured while reading) if($reader->nodeType == 1) { //return xmlToAssocArray($reader); // Pass XmlReader to array converter. } } } Expected result: ---------------- I want that script go on working, with hiding of parsing errors (see $data it contain incorrect xml document). And I cant find any solution to obtain this result. Actual result: -------------- Scrip terminates and show this error (((( XMLReader::read(): file:///D:/WWW/ksystem/debug/:1: parser error : Document is empty [D:\WWW\ksystem\debug\index.php, line: 45]