Oh, der Chef persönlich.....
Hier die komplette Prozedur:
Code:
procedure TMainForm.UpdateList;
const
NAMES: array[0..2] of string = ('name', 'format', 'ton');
var
movies: IXMLDOMNodeList;
subNode: IXMLDOMNode;
i, j: integer;
begin
MovieList.Items.Clear;
MovieList.Items.BeginUpdate;
movies:=xmlDoc.documentElement.selectNodes('movie');
for i:=0 to movies.length - 1 do begin
subNode := movies.item[i].selectSingleNode('id');
MovieList.Items.Add;
MovieList.Items[i].Caption := subnode.text;
with MovieList.Items[i].SubItems do begin
for j:=0 to length(NAMES)-1 do begin
subNode := movies.item[i].selectSingleNode(NAMES[j]);
if subNode <> nil then
Add(subNode.Text)
else
Add('');
end;
end;
end;
MovieList.items.endupdate;
end;
Das einzigste was zum Tutorial abweicht ist das ich nur 3 Felder hab statt 9
mfg
p0ke