I am trying to find an element in an XML document in Delphi. I have this code, but it always says 0 elements in the log:
function TForm1.KannaSidu: Boolean;
If you're just trying to load a plain html file as xml, it would probably have multiple reasons to fail and choke on things like:
You have to test that it actually loads correctly before doing anything else:
if not Doc.load(filename) then
raise Exception.Create('XML Loading error:' + Trim(Doc.parseError.reason));
It will give you the specific reason for the failure like this one:
XML Loading error:End tag 'head' does not match the start tag 'link'.