TXMLDocumentCreateElement (Delphi)

From RAD Studio Code Examples
Revision as of 20:19, 3 November 2011 by L10nBot (talk | contribs) (normalized vcl links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Description

This example uses the CreateElement function.

Code

procedure Test_CreateElement;
var
  LDocument: IXMLDocument;
  LNode: IXMLNode;
begin
  LDocument := TXMLDocument.Create(nil);
  LDocument.Active := True;

  LNode := LDocument.CreateElement('TestElement', '');
  LDocument.DocumentElement := LNode;

  { Display document content. }
  Writeln(LDocument.XML.Text);
end;

Uses