TXMLDocumentSaveToXML (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example uses the SaveToXML function.

Code

procedure Test_SaveToXML;
const
  CFilename = 'file.xml';  { Should exist. }
var
  LDocument: IXMLDocument;
  LContent: DOMString;
begin
  LDocument := TXMLDocument.Create(nil);
  LDocument.LoadFromFile(CFilename);

  { Save content to DOM string and display the string. }
  LDocument.SaveToXML(LContent);
  Writeln(LContent);
end;

Uses