Delphi ActiveX
Delphi ActiveX
Convert HTML File to XML File
See more HTML-to-XML/Text Examples
Convert HTML file to 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;
htmlToXml: THtmlToXml;
begin
success := 0;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
htmlToXml := THtmlToXml.Create(Self);
// Indicate the charset of the output XML we'll want.
htmlToXml.XmlCharset := 'utf-8';
success := htmlToXml.ConvertFile('test.html','out.xml');
if (success <> 1) then
begin
Memo1.Lines.Add(htmlToXml.LastErrorText);
end
else
begin
Memo1.Lines.Add('Success');
end;
end;