The IXMLNodeList
is a collection of IXMLNode
items in whose you can access attributes by name through the Attributes
property. In pseudo code it might look like this:
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
TransUnits: IXMLNodeList;
XMLDocument: IXMLDocument;
begin
XMLDocument := LoadXMLDocument('d:\File.xml');
if Assigned(XMLDocument) then
begin
TransUnits := XMLDocument.DocumentElement.ChildNodes['file'].ChildNodes['body'].ChildNodes;
for I := 0 to TransUnits.Count - 1 do
ShowMessage(TransUnits[I].Attributes['id']);
end;
end;