|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-10-06 18:32 UTC] pajoye@php.net
-Status: Open
+Status: Bogus
[2010-10-06 18:32 UTC] pajoye@php.net
[2010-10-06 18:40 UTC] php at oshahn dot de
[2010-10-06 18:54 UTC] php at oshahn dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 01:00:01 2025 UTC |
Description: ------------ If there is a newline befor the XML-declaration, the parser fails. The w3.org only demand: "The document type declaration MUST appear before the first element in the document." Test script: --------------- <?php $data = '<?xml version="1.0"?><foo>bar</foo>'; function test($data) { print "try to parse: '" . htmlentities($data) . "'<br>\n"; $parser = xml_parser_create(); if (!xml_parse($parser, $data)) { print "Error: " . xml_error_string(xml_get_error_code($parser)) . "<br>"; print "Error in Line " . xml_get_current_line_number($parser) . " Column " . xml_get_current_column_number($parser) . "<hr>\n"; } else { print "works fine<hr>"; } } test($data); test("\n" . $data); Expected result: ---------------- I expect, that both test succeed. Actual result: -------------- Only the first test succeed, the second fails in Line 1 Column 21 "Reserved XML Name".