Edit report at http://bugs.php.net/bug.php?id=48898&edit=1

 ID:               48898
 Updated by:       rricha...@php.net
 Reported by:      boen dot robot at gmail dot com
 Summary:          readOuterXML() doesn't work on DTDs
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          XML Reader
 Operating System: Windows Vista Ultimate x64 SP2
 PHP Version:      5.3.0

 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.

The problem lies within libxml2. Bug is being handled there.


Previous Comments:
------------------------------------------------------------------------
[2009-07-12 21:41:35] boen dot robot at gmail dot com

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 this bug report at http://bugs.php.net/bug.php?id=48898&edit=1

Reply via email to