Prevent from Deleting the secondary Datasource

D

DolceVita

Hi,

When I make an appendChild with an IXMLDOMNode of my Secondary
Datasource the node selected is erase from my Secondary Datasource!

How can I prevent this?

My Code:

IXMLDOMNode Old = e.Source.parentNode.parentNode;

IXMLDOMDocument2 oDomgetHRGBisher =
(IXMLDOMDocument2)thisXDocument.GetDOM("getHRGBisher");
oDomgetHRGBisher.setProperty("SelectionNamespaces",
"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\"
xmlns:ns2=\"http://tempuri.org/\"");

IXMLDOMNode SelectBisher =
oDomgetHRGBisher.selectSingleNode("/dfs:myFields/dfs:dataFields/ns2:getHRGBisherResponse/ns2:getHRGBisherResult/ListBisher/Bisher[@fldID="
+ FLDID +"]");

if (SelectBisher != null)
{
Old.appendChild(SelectBisher);
}

Thanks for your help!
 
D

DolceVita

Ok I have found:

if (SelectBisher != null)
{
IXMLDOMNode SelectBisher2 = SelectBisher.CloneNode(false);
Old.appendChild(SelectBisher2);
}


cloneNode can can true or false:

true: Copy child of the node and the node

false: Copy only the node with the attribute.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top