Sample code for 30+ languages & platforms
Delphi DLL

Convert HTML File to XML File

See more HTML-to-XML/Text Examples

Convert HTML file to XML file.

Chilkat Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, HtmlToXml;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Boolean;
htmlToXml: HCkHtmlToXml;

begin
success := False;

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

htmlToXml := CkHtmlToXml_Create();

// Indicate the charset of the output XML we'll want.
CkHtmlToXml_putXmlCharset(htmlToXml,'utf-8');

success := CkHtmlToXml_ConvertFile(htmlToXml,'test.html','out.xml');
if (success <> True) then
  begin
    Memo1.Lines.Add(CkHtmlToXml__lastErrorText(htmlToXml));
  end
else
  begin
    Memo1.Lines.Add('Success');
  end;

CkHtmlToXml_Dispose(htmlToXml);

end;