RAD Studio VCL Reference
TXMLDocument.AddChild Method (DOMString)

Creates and adds a node to the child nodes of this document.

function AddChild(const TagName: DOMString): IXMLNode; overload;
function AddChild(const TagName: DOMString; const NamespaceURI: DOMString): IXMLNode; overload;
__fastcall IXMLNode AddChild(const DOMString TagName);
__fastcall IXMLNode AddChild(const DOMString TagName, const DOMString NamespaceURI);

Call AddChild to add a new child element node to the document itself. The new node is added to the end of the list maintained by the ChildNodes property. 

TagName is the tag name for the new element node. 

NamespaceURI identifies the namespace, if any, that includes the new node's definition. 

AddChild returns the interface for the newly created node.

Note: Do not call AddChild to add a child to the document element of this document. When adding data to the XML document, use the AddChild method of the document element or of the node in the hierarchy that should be the parent of the new node.


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!