Doc #77219 [Com]: childNodes property not in DOMElement manual
| From: | Wes dot example at example dot org | Date: | Thu, 29 Nov 2018 12:38:43 +0000 |
| Subject: | Doc #77219 [Com]: childNodes property not in DOMElement manual | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16184@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77219&edit=1
ID: 77219
Comment by: Wes dot example at example dot org
Reported by: pavel dot pilat at gmail dot com
Summary: childNodes property not in DOMElement manual
Status: Open
Type: Documentation Problem
Package: DOM XML related
Operating System: Windows 7 x64 SP1
PHP Version: 7.1.24
Block user comment: N
Private report: N
New Comment:
It's in DOMNode, DOMElement extends DomNode
Previous Comments:
------------------------------------------------------------------------
[2018-11-29 12:35:38] pavel dot pilat at gmail dot com
Description:
------------
I ran into this code (from https://www.w3schools.com/php/php_xml_dom.asp),
you may see it in the test script section.
I tried it and it works. What attracted my attention was "childNodes" property of $x which
is DOMElement. The manual page for the class DOMElement does not describe this property. Please add
it.
http://php.net/manual/en/class.domelement.php
Test script:
---------------
<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("note.xml");
$x = $xmlDoc->documentElement;
foreach ($x->childNodes AS $item) {
print $item->nodeName . " = " . $item->nodeValue . "<br>";
}
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77219&edit=1