Schade, dass du deinen Code nicht zeigen kannst. Ich hatte gefragt, weil ich da kein Problem kenne:
Delphi-Quellcode:
uses
MSXML2;
procedure TMainForm.ButtonClick(Sender: TObject);
var
inDoc: IXMLDOMDocument2;
outDoc: IXMLDOMDocument2;
nIn, nOut: IXMLDOMNode;
msg: String;
begin
inDoc := CoDomDocument.Create;
inDoc.async := False;
outDoc := CoDomDocument.Create;
outDoc.async := False;
with inDoc do
begin
documentElement := CreateElement('inroot');
nIn := documentElement.appendChild(CreateElement('intest'));
end;
with outDoc do
begin
documentElement := CreateElement('outroot');
nOut := documentElement.appendChild(CreateElement('outtest'));
nOut.appendChild(nIn.cloneNode(False));
if Assigned(inDoc.documentElement)
then msg := inDoc.xml
else msg := 'n/a';
ShowMessage('after node copy:'#13#10
+ 'inDoc.xml:'#13#10
+ msg + #13#10
+ 'outDoc.xml:'#13#10
+ outDoc.documentElement.xml
);
end;
with outDoc do
begin
documentElement := inDoc.documentElement;
if Assigned(inDoc.documentElement)
then msg := inDoc.xml
else msg := 'n/a';
ShowMessage('after node transfer:'#13#10
+ 'inDoc.xml:'#13#10
+ msg + #13#10
+ 'outDoc.xml:'#13#10
+ outDoc.documentElement.xml
);
end;
end;
marabu