|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-27 21:36 UTC] rrichards@php.net
[2006-04-28 12:24 UTC] dennis at inmarket dot lviv dot ua
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 04:00:02 2025 UTC |
Description: ------------ XMLReader never returns XMLReader::XML_DECLARATION nodes in a call to XMLReader::read() (silently skips them, however, complains about well-formedness if the XML declaration is not at the very beginning of the XML, ie, after a comment or the DTD) Reproduce code: --------------- <?php $xmld = <<<EOT <?xml version="1.0" encoding="UTF-8" ?> <!-- Prolog comment 1--> <!DOCTYPE chapter [ <!ELEMENT chapter (title,para+)> <!ELEMENT title (#PCDATA)> <!ELEMENT para (#PCDATA)> ]> <!-- prolog comment 2--> <!-- prolog comment 3--> <chapter><title>Title</title><para>Para</para></chapter> EOT; $xml = new XMLReader(); $xml->XML($xmld); while($xml->read()) { echo "$xml->nodeType \n"; } ?> Expected result: ---------------- 17 <- the nodeType value for XMLReader::XML_DECLARATION 8 10 8 8 1 1 3 15 1 3 15 15 Actual result: -------------- 8 10 8 8 1 1 3 15 1 3 15 15