|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-04-27 22:36 UTC] mookid at sigent dot ru
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 02:00:01 2025 UTC |
My XML parsing exercises have stuck with xml_parse() returning an 'out of memory' error. Here's a text script: <?php header('Content-Type: text/html'); function StartTag($parser, $tag, $attrs) { echo "<$tag"; while (list ($attr, $value) = each($attrs)) { echo " $attr"; if (!empty($value)) { echo "=\"$value\""; } } echo ">"; } $parser = xml_parser_create(); if (!$parser) { die('xml_parser_create failed: ' . xml_error_string($parser)); } if (!xml_set_element_handler($parser, 'StartTag', FALSE)) { die('xml_set_element_handler failed: ' . xml_error_string($parser)); } $data = '<tag attr1 attr2="this is a test " "/>'; // $data = ''; if (!xml_parse($parser, $data, TRUE)) { die('xml_parse failed: ' . xml_error_string($parser)); } ?> I'm using Apache 1.3.12 with the Russian patch. Both Apache and PHP were compiled with Expat in mind, so that xml_* functions exist. This occurs on two Linux installations, one being Mandrake 7.0, other is the recent Slackware. Peeking at the source, I found that it's rather Apache/Expat misbehaviour, and PHP source comments say something of that kind. Any chance that it can be fixed?