This thread is probably off-topic for this list. I would suggest moving
further questions to the w3-dom discussion list (see http://www.w3.org/).


> Sorry for jumping into this discussion, but when you say that the node
> still exists after you remove it, what happens when I do the following?
>
>    nodeToDelete.getParentNode().deleteChildNode(nodeToDelete);
>
> Is it not "deleted"?
> Can I still access nodeToDelete somehow?

The Node interface, as specified by the DOM, doesn't have a
'deleteChildNode' operation.  It instead has a 'removeChild' operation. The
DOM specification intentionally left memory management details to
implementors.

public Node removeChild(Node oldChild)
                 throws DOMException;

The removeChild operation removes a child from a parent's child list, and
returns it to the caller.
With an implementation that supports garbage collection (like Java or
JavaScript), if you don't retain a reference to the removed node, it will
eventually be deleted. With an implementation that doesn't support garbage
collection, it's up to the implementation to specify how the node is
deleted.



  • elemen... heather_matthews
    • R... Jeff Mackay
      • ... Christian Lizell
        • ... Jeff Mackay
          • ... Christian Lizell
          • ... Andy Heninger
    • R... Sean MacRoibeaird - Sun ireland - Solaris Software - Staff Engineer

Reply via email to