XML.removeNode( ) Method | Flash 5 |
delete a node from an XML object hierarchy |
The removeNode( ) method deletes theNode from an XML document, where theNode can be an XML or XMLnode instance. All descendants (children, grandchildren, and so on) of theNode are also deleted. The childNodes property of theNode's parent is automatically updated to reflect the new structure of the remaining object hierarchy.
Here we delete the second child node; the third child node takes its place:
myDoc = new XML("<P>one</P><P>two</P><P>three</P>"); myDoc.childNodes[1].removeNode(); trace(myDoc); // Displays: "<P>one</P><P>three</P>"
XML.appendChild( ), XML.insertBefore( )