note 109814 added to function.xml-error-string
| From: | greg at getnetez dot com | Date: | Thu, 23 Aug 2012 19:27:53 +0000 |
| Subject: | note 109814 added to function.xml-error-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190196@lists.php.net to get a copy of this message | ||
Two notes in one.
Here is the combination of xml_get_error_code() and xml_error_string() to get the error printout as
an echo response
Also, I tested before and after xml_parser_free() -- as expected, the error is indeed cleared with
the free() so check your error before calling xml_parser_free()
Pushing a deadline or I would add in sample faulted xml for full p.o.c.
somebody else want to step up for that??
G
$p = xml_parser_create();
xml_parse_into_struct($p, $data, $vals, $index);
//This call prints error
echo 'ERROR if any '.xml_error_string(xml_get_error_code($p));
xml_parser_free($p);
echo "Index array\n";
print_r($index);
echo "\nVals array\n";
print_r($vals);
//No Error left here to be printed
echo 'ERROR if any '.xml_error_string(xml_get_error_code($p));
exit;
----
Server IP: 192.41.42.26
Probable Submitter: 70.184.76.92
----
Manual Page -- http://www.php.net/manual/en/function.xml-error-string.php
Edit -- https://master.php.net/note/edit/109814
Del: integrated -- https://master.php.net/note/delete/109814/integrated
Del: useless -- https://master.php.net/note/delete/109814/useless
Del: bad code -- https://master.php.net/note/delete/109814/bad+code
Del: spam -- https://master.php.net/note/delete/109814/spam
Del: non-english -- https://master.php.net/note/delete/109814/non-english
Del: in docs -- https://master.php.net/note/delete/109814/in+docs
Del: other reasons-- https://master.php.net/note/delete/109814
Reject -- https://master.php.net/note/reject/109814
Search -- https://master.php.net/manage/user-notes.php