Is there a way to speed up the the reading of the xml file - is it
possible to stop the reading execution before the whole file is read?
The progress bar calculation don't seem to work properly. to How can
I
make the progress bar show the remaining reading execution?
Regards
Frank Krogh
________________________________
procedure ParseThisFile (myXmlFile: string;fileNumber:integer);
var
Parser: TXmlParser;
XmlFileName, foundValue: string;
DocSize : integer;
begin
Parser := TXmlParser.Create;
Parser.Normalize := True;
Parser.loadfromfile (myXmlFile);
DocSize := StrLen (Parser.DocBuffer);
Parser.StartScan;
While Parser.Scan do
Case Parser.CurPartType of
ptStartTag: begin
foundValue := parser.curattr.value('companyID');
if trim(foundValue) <> '' then
Form1.StringGrid1.cells[1,fileNumber + 1]:= foundValue;
foundValue :=
parser.curattr.value('businessType');
if trim(foundValue) <> '' then
Form1.StringGrid1.cells[2,fileNumber + 1]:= foundValue;
foundValue := parser.curattr.value('State');
if trim(foundValue) <> '' then
Form1.StringGrid1.cells[3,fileNumber + 1]:= foundValue;
end;
End; {case}
Form1.ProgressBar1.Position := Trunc(( Parser.CurFinal -
Parser.DocBuffer) / DocSize * 100.0);
Parser.Free;
end;