ID: 31589 Updated by: [EMAIL PROTECTED] Reported By: fuddyq at gmail dot com -Status: Open +Status: Feedback Bug Type: XML related Operating System: Windows2000 PHP Version: 5.0.2 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. I can't reproduce it. Make sure $data is not empty and error_reporting is set to E_ALL. Previous Comments: ------------------------------------------------------------------------ [2005-01-18 00:04:28] fuddyq at gmail dot com Description: ------------ When using the documentation for xml_parse_into_struct to test xml read from a file, the function appears to unsuccessfully parse the data. The xml file is valid xml, is being read properly and can be dumped by it's fread variable $data. I can copy and paste the xml into the $data variable and the function will work properly. The xml_error_string(xml_get_error_code($parser)) is "Empty Document" which is incorrect. Reproduce code: --------------- $xml_file = 'someXMLfile.xml'; $filehandler = fopen($xml_file, 'r'); $data = fread($filehandler, filesize($xml_file)); fclose($filehandler); $parser = xml_parser_create(); xml_parse_into_struct($parser, $data, $vals, $index); xml_parser_free($parser); echo "Index array\n"; print_r($index); echo "\nVals array\n"; print_r($vals); Expected result: ---------------- Similar results to the documentation for the xml_parse_into_struct() function via print_r(). Actual result: -------------- Index array Array ( ) Vals array Array ( ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31589&edit=1