#37228 [Opn->Bgs]: XMLReader never returns XMLReader::XML_DECLARATION nodes
| From: | rrichards@php.net | Date: | Thu, 27 Apr 2006 21:36:58 +0000 |
| Subject: | #37228 [Opn->Bgs]: XMLReader never returns XMLReader::XML_DECLARATION nodes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-96298@lists.php.net to get a copy of this message | ||
ID: 37228
Updated by: rrichards@php.net
Reported By: dennis at inmarket dot lviv dot ua
-Status: Open
+Status: Bogus
Bug Type: *XML functions
Operating System: WinXP
PHP Version: 5CVS-2006-04-27 (snap)
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
This is a known issue in libxml2
Previous Comments:
------------------------------------------------------------------------
[2006-04-27 21:20:55] dennis at inmarket dot lviv dot ua
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37228&edit=1