note 83513 deleted from class.domnodelist by joey
| From: | joey@php.net | Date: | Tue, 16 Oct 2012 00:55:18 +0000 |
| Subject: | note 83513 deleted from class.domnodelist by joey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191315@lists.php.net to get a copy of this message | ||
Note Submitter: a dot buffa at sns dot it
----
I agree with drichter at muvicom dot de.
For istance, in order to delete each child node of a particular parent node,
<?php
while ($parentNode->hasChildNodes()){
$domNodeList = $parentNode->childNodes;
$parentNode->removeChild($domNodeList->item(0));
}
?>
In other word you have to uptade the DomNodeList on every iteration.
In my opinion, the DomNodeList class is useless.