(Delphi ActiveX) SearchAllForContent
Demonstrates the SearchAllForContent method.
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
xml: TChilkatXml;
xBeginAfter: IChilkatXml;
xFound: IChilkatXml;
success: Integer;
searchForMore: Integer;
begin
xml := TChilkatXml.Create(Self);
success := xml.LoadXmlFile('qa_data/xml/pigs.xml');
if (success <> 1) then
begin
Memo1.Lines.Add(xml.LastErrorText);
Exit;
end;
xBeginAfter := xml.GetSelf();
xFound := xml.SearchAllForContent(xBeginAfter,'*pig*');
searchForMore := 1;
while (searchForMore = 1) do
begin
Memo1.Lines.Add(xFound.Tag);
Memo1.Lines.Add(xFound.Content);
Memo1.Lines.Add('--');
xBeginAfter := xFound;
xFound := xml.SearchAllForContent(xBeginAfter,'*pig*');
searchForMore := xml.LastMethodSuccess;
end;
end;
|