RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TXMLDocument.CreateElement Method

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

Pascal
function CreateElement(const TagOrData: DOMString; const NamespaceURI: DOMString): IXMLNode;
C++
__fastcall IXMLNode CreateElement(const DOMString TagOrData, const DOMString NamespaceURI);

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.
 

 

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