#48504 [NEW]: document_element contains nothing
| From: | ikrabbe dot ask at web dot de | Date: | Tue, 09 Jun 2009 10:48:36 +0000 |
| Subject: | #48504 [NEW]: document_element contains nothing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-138135@lists.php.net to get a copy of this message | ||
From: ikrabbe dot ask at web dot de
Operating system: Linux
PHP version: 5.2.9
PHP Bug Type: DOM XML related
Bug description: document_element contains nothing
Description:
------------
on
$xml="<a><b>abc</b><c/></a>";
$xmldoc = new DOMDocument();
$xmldoc->loadXML($xml);
I get for
echo "item 0=".$xmldoc->childNodes->item(0)->nodeName."\n";
echo "root =".$xmldoc->document_element->nodeName."\n";
the output:
item 0=a
root=
I assumed that document_element should be the same as childNodes->item(0),
so I assume that is a bug.
Reproduce code:
---------------
see above
Expected result:
----------------
see above
Actual result:
--------------
see above
--
Edit bug report at http://bugs.php.net/?id=48504&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48504&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48504&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48504&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48504&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48504&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48504&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48504&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48504&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48504&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48504&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48504&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48504&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48504&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48504&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48504&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48504&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48504&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48504&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48504&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48504&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48504&r=mysqlcfg