ups, immer diese Indize beim Copy&Paste
Code:
[color=#0000AF][b]for[/b][/color] i2 := 0 [color=#0000AF][b]to[/b][/color] NodeBase.childNodes[i].childNodes.length - 1 [color=#0000AF][b]do[/b][/color]
NodeBase.childNodes[i].removeChild(NodeBase.childNodes[[b]i2[/b]].[b]firstChild[/b]);
oder?
Code:
NodeBase.childNodes[i].[b]firstChild[/b].removeChild(NodeBase.childNodes[[b]i2[/b]].[b]firstChild[/b]);
Delphi-Quellcode:
while Assigned(NodeAnother) do
begin
NodeNext := NodeAnother.NextSibling;
i := 0;
while (i < NodeBase.childNodes.length)
and (NodeBase.childNodes[i].firstChild.text
<> NodeAnother.firstChild.text) do
Inc(i);
if i < NodeBase.childNodes.length then
begin
for i2 := 0 to NodeBase.childNodes[i].childNodes.length - 1 do
NodeBase.childNodes[i].removeChild(NodeBase.childNodes[i2].firstChild);
for i2 := 0 to NodeAnother.childNodes.length - 1 do
NodeBase.childNodes[i].appendChild(NodeAnother.childNodes[0]);
end else
NodeBase.appendChild(NodeAnother);
NodeAnother := NodeNext;
end;