Name

XML.removeNode( ) Method — delete a node from an XML object hierarchy

Availability

Flash 5

Synopsis

theNode.removeNode( )

Description

The removeNode( ) method deletes theNode from an XML document. 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.

Example

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>"

See Also

XML.appendChild( )

Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.