Xml.XMLDoc.TXMLDocument.CreateElement

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CreateElement(const TagOrData, NamespaceURI: DOMString): IXMLNode;

C++

Xml::Xmlintf::_di_IXMLNode __fastcall CreateElement(const System::UnicodeString TagOrData, const System::UnicodeString NamespaceURI);

Properties

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

Description

Creates a new element node that is associated with this document.

Call CreateElement to create a new generic element node. The resulting node does not have a parent, but can be added to the ChildNodes list of any node in the document (including this document's ChildNodes property). It can also be assigned to the DocumentElement property to replace the entire data hierarchy of this document.

TagOrData provides the tag name of the newly created node.

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

CreateElement returns the interface for the new node.

Note: To add a node as the child of another node in this document, it is simpler to call that node's AddChild method.

See Also

Code Examples