[XML-SIG] Removing a set of DOM nodes
Fri, 7 Jan 2000 17:50:08 -0500
I have a quick question about removing a node and all it's children
nodes from a DOM tree.
I have an application where I identify a particular node in a DOM
tree and then need to remove it and all of its subnodes from the tree. The
tree can branch quite far beneath the node I am deleting, so there are many
sub-sub...-sub-nodes under the parent node. So far I have just been dealing
with this by destroying all of the nodes immmediate child nodes by
iterating through them and applying nodeToDelete.removeChild(oldNode), and
then deleting the parent node.
Although this has the desired affect (gets the node and everything
under it out of the tree) I am curious about memory leakage. Are all of the
sub-sub...-sub-nodes that were not explicitly deleted removed once they are
detached from the main document node, or do they continue to exist? And, if
they do need to be explicitly deleted, is there any code already available
that does this? (ie. a class inheriting from the Walker class)
Thanks in advance for any advice!