Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Copying XML Fragments

From: "news.microsoft.com" <afds>
To: NULL
Date: 3/11/2008 11:01:00 AM

I need to copy the data/structure from one XML file to another.

I found I can get to the data I need, it resides under a node I can navigate 
to:



XPathDocument _docSrc = new XPathDocument(_pathSrc);

XPathNavigator navSrc = ((IXPathNavigable)_docSrc).CreateNavigator();

XPathNavigator grpSrc = navSrc.SelectSingleNode("/A/B/C/D");

XPathDocument _docDst = new XPathDocument(_pathDst);

XPathNavigator navDst = ((IXPathNavigable)_docDst).CreateNavigator();

XPathNavigator grpDst = navDst.SelectSingleNode("/A/B/C/D");




Essentially, I need everything under the D node in Dst to be erased.  How do 
I do that, first of all?

Second, I need to copy everything from under the D node in Src to under the 
D node in Dst.  What is the simples way to do that?



TIA-









transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent