Click to return to the XML (Extensible Markup Language) home page    
XMLDOMNode previousSiblin...     XMLDOMNode replaceChild M...     XMLDOMNode Object    
Web Workshop  |  XML (Extensible Markup Language)

removeChild Method


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

Syntax

objXMLDOMNode = oXMLDOMNode.removeChild(oldChild)

Parameters

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

Returns

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("microsoft.xmldom")
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

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XMLDOMAttribute, XMLDOMCDATASection, XMLDOMCharacterData, XMLDOMComment, XMLDOMDocument, XMLDOMDocumentFragment, XMLDOMDocumentType, XMLDOMElement, XMLDOMEntity, XMLDOMEntityReference, XMLDOMNode, XMLDOMNotation, XMLDOMProcessingInstruction, XMLDOMText, XTLRuntime


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.