Xml.XMLDoc.TXMLDocument.AddChild

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

Xml::Xmlintf::_di_IXMLNode __fastcall AddChild(const System::UnicodeString TagName)/* overload */;
Xml::Xmlintf::_di_IXMLNode __fastcall AddChild(const System::UnicodeString TagName, const System::UnicodeString NamespaceURI)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
Xml.XMLDoc.pas
Xml.XMLDoc.hpp
Xml.XMLDoc TXMLDocument

Description

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

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.

See Also

Code Examples