Delphi ActiveX
Delphi ActiveX
Load XML from Local FilePath
Demonstrates how to load XML from a local XML file.Chilkat Delphi ActiveX Downloads
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;
...
procedure TForm1.Button1Click(Sender: TObject);
var
success: Integer;
xml: TChilkatXml;
begin
success := 0;
xml := TChilkatXml.Create(Self);
// Pass either an absolute file path, or a file path relative from the current working directory of the caller.
success := xml.LoadXmlFile('qa_data/hamlet.xml');
if (success = 0) then
begin
Memo1.Lines.Add(xml.LastErrorText);
Exit;
end;
Memo1.Lines.Add('Success.');
end;