RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
XMLDoc.CreateDOMNode Function

Creates a new DOM node and returns its interface.

Pascal
function CreateDOMNode(Doc: IDOMDocument; const NameOrData: DOMString; NodeType: TNodeType = ntElement; const AddlData: DOMString = ''): IDOMNode;
C++
IDOMNode CreateDOMNode(IDOMDocument Doc, const DOMString NameOrData, TNodeType NodeType = ntElement, const DOMString AddlData = '');

CreateDOMNode generates a new DOM node. 

Doc is the DOM interface for the document to which the new node will belong. 

NameOrData provides the tag name or value of the newly created node. Its interpretation depends on the type of node created, as indicated in the following table:

NodeType 
NameOrData 
ntElement  
The tag name.  
ntAttribute  
The attribute name.  
ntText  
The value of the node.  
ntCData  
The value of the CDATA section.  
ntEntityRef  
The name of the referenced entity.  
ntProcessingInstr  
The target of the processing instruction.  
ntComment  
The value (text) of the comment.  
ntDocFragment  
Not used.  

NodeType indicates the type of node to create. It can only be one of the types listed in the previous table. 

The meaning of AddlData depends on the node type, as indicated in the following table:

NodeType 
AddlData 
ntElement  
The namespace URI that qualifies the tag name.  
ntAttribute  
The namespace URI that qualifies the attribute name.  
ntProcessingInstr  
The content of the processing instruction, except for the target.  

CreateDOMNode returns the interface for the newly created DOM node. 

 

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