From: boen dot robot at gmail dot com
Operating system: Windows Vista Ultimate x64 SP2
PHP version: 5.3.0
PHP Bug Type: XML Reader
Bug description: readOuterXML() doesn't work on DTDs
Description:
------------
When reading an XML document with XMLReader, you can't use readOuterXML()
to read the value of some node types, DTD being the most noticeable and
disturbing one.
While for readInnerXML(), the "inner" part may be hard to define in those
node types, the "outer" is always clearly the whole node, and all of its
descendants.
If the root of the problem is in libxml, may I ask the maintainers of this
extension to forward this to libxml's authors? I'm not a C user of libxml,
so coming in with a runnable test case for libxml's authors would be hard.
PHP runs on Apache 2.2.9 as CGI, and is the VC6 x86 Thread-safe build
(just in case it matters).
Reproduce code:
---------------
<?php
$reader = new XMLReader;
$reader->XML('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>It works...</title>
</head>
<body>
<h1>It works!</h1>
</body>
</html>');
$reader->read();
echo $reader->readOuterXML();
?>
Expected result:
----------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Actual result:
--------------
An empty string.
--
Edit bug report at http://bugs.php.net/?id=48898&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48898&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48898&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48898&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48898&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48898&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48898&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48898&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48898&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48898&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48898&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48898&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48898&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48898&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48898&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48898&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48898&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48898&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48898&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48898&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48898&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48898&r=mysqlcfg