Microsoft XML SDK 2.6 - XML Reference

removeChild Method

Removes the specified child node from the list of children and returns it.

objXMLDOMNode = oXMLDOMNode.removeChild(oldChild)

Parameters

oldChild
Object. Child node to be removed from the list of children of this node.

Return Value

Object. Returns the removed child node.

Example

The following VBScript example creates an XMLDOMNode object (currNode), removes a child node from it, and displays the text of the removed node:

Dim xmlDoc
Dim root
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set root = xmlDoc.documentElement
Set currNode = root.childNodes.item(1)
Set oldChild = currNode.removeChild(currNode.childNodes.item(1))
MsgBox oldChild.text

See Also

Applies To: XMLDOMAttribute Object | XMLDOMCDATASection Object | XMLDOMCharacterData Object | XMLDOMComment Object | DOMDocument Object | XMLDOMDocumentFragment Object | XMLDOMDocumentType Object | XMLDOMElement Object | XMLDOMEntity Object | XMLDOMEntityReference Object | XMLDOMNode Object | XMLDOMNotation Object | XMLDOMProcessingInstruction Object | XMLDOMText Object | XTLRuntime Object