TXMLDocumentCreateNode (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This example uses the CreateNode function.

Code

procedure Test_CreateNode;
var
  LDocument: IXMLDocument;
  LNode: IXMLNode;
begin
  LDocument := TXMLDocument.Create(nil);
  LDocument.Active := True;
 
  LNode := LDocument.CreateNode('TestElement', ntElement);
  LDocument.DocumentElement := LNode;
  LNode.ChildNodes.Add(LDocument.CreateNode('TestComment', ntComment));
 
  { Display document content. }
  Writeln(LDocument.XML.Text);
end;

Uses

Personal tools
RAD Studio 10.2 Tokyo
Assistance