Microsoft XML SDK 2.6 - XML Reference

appendChild Method

Appends newChild as the last child of this node.

objXMLDOMNode = oXMLDOMNode.appendChild(newChild)

Parameters

newChild
Object. Address of the new child node to be appended at the end of the list of children belonging to this node.

Return Value

Object. Returns the new child node successfully appended to the list.

Remarks

Note that this is equivalent to calling insertBefore(newChild, null). For complete information, see the insertBefore method.

Example

The following VBScript example creates a new XMLDOMNode object, and then uses the appendChild method to append it to the document's list of children:

Dim xmlDoc
Dim root
Dim newNode
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set root = xmlDoc.documentElement
MsgBox root.xml
Set newNode = xmlDoc.createNode (1, "VIDEOS", "")
root.appendChild(newNode)
MsgBox root.xml

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