(Delphi DLL) Convert HTML File to XML File
Convert HTML file to XML file.
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
htmlToXml: HCkHtmlToXml;
success: Boolean;
begin
// 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;
|