TXMLDocumentLoadFromFile (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example uses the LoadFromFile function.

Code

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

  LDocument.LoadFromFile(CFilename);

  { Display document element local name. }
  if LDocument.DocumentElement <> nil then
    Writeln(LDocument.DocumentElement.LocalName);
end;

Uses