Click to return to the XML (Extensible Markup Language) home page    
XMLDOMNode attributes Pro...     XMLDOMNode Object    
Web Workshop  |  XML (Extensible Markup Language)

appendChild Method


Appends newChild as the last child of this node.

Syntax

objXMLDOMNode = oXMLDOMNode.appendChild(newChild)

Parameters

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

Returns

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 documentation for insertBefore.

Example

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

Dim xmlDoc
Dim root
Dim newNode

Set xmlDoc = CreateObject("microsoft.xmldom")
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

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.