TXMLDocumentSaveToFile (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example uses the SaveToFile function.

Code

procedure Test_SaveToFile;
const
  CFilename = 'file.xml';
var
  LDocument: IXMLDocument;
  LNode: IXMLNode;
begin
  LDocument := TXMLDocument.Create(nil);
  LDocument.Active := True;

  { Define document content. }
  LNode := LDocument.CreateNode('TestElement');
  LDocument.DocumentElement := LNode;

  LDocument.SaveToFile(CFilename);
end;

Uses