eventuell so?
Delphi-Quellcode:
while Assigned(NodeAnother) do
begin
NodeNext := NodeAnother.NextSibling;
i := 0;
while (i < NodeBase.childNodes.length)
and (mot Assigned(NodeBase.childNodes[i].firstChild)
or not Assigned(NodeAnother.firstChild)
or (NodeBase.childNodes[i].firstChild)
<> 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[i].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;
[edit]
ups ... noch schnell ein paar NOT einbauen