|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-04 19:58 UTC] rrichards@php.net
-Status: Open
+Status: Bogus
[2010-05-04 19:58 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |
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.