Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Copy a sub tree into another XML document [Thread Next] Re: Copy a sub tree into another XML documentTo: NULL Date: 5/4/2005 4:03:00 PM
Pierre wrote:
> I'm using c# and DOM to try to copy a sub tree (throught XmlNodeList)
> into another XML document.
If you want to copy nodes from one document to another then you need to
use the ImportNode method of one document to import each node as needed.
Then you can insert the imported node as needed e.g.
foreach (XmlNode node in nodeList) {
XmlNode importedNode = xmlDocument2.importNode(node, true);
// now insert imported node e.g.
xmlDocument2.DocumentElement.AppendChild(importedNode);
}
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
