var
iNumber, iName, iTown, iDate: string;
Employees, Payments: IXMLNode;
i: integer;
begin
XMLDocument1.Active := False;
XMLDocument1.XML.LoadFromFile(
'C:\Temp4-XML\Project1\XMLSourceFile\SourceFile - MasterDetail.xml');
XMLDocument1.Active := True;
Employees := XMLDocument1.DocumentElement;
for i := 0 to Employees.ChildNodes.Count - 1 do
begin
iNumber := Employees.ChildNodes[i].ChildNodes['Number'].Text;
iName := Employees.ChildNodes[i].ChildNodes['Name'].Text;
iTown := Employees.ChildNodes[i].ChildNodes['Town'].Text;
Payments := Employees.ChildNodes[i].ChildNodes['Payments'];
iDate := Payments.ChildNodes['Date'].Text;
ListBox1.Items.Add(iNumber + ',' + iName + ',' + iTown + ',' + iDate);
end;
end;
|