Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Copy a sub tree into another XML document Copy a sub tree into another XML documentTo: NULL Date: 5/4/2005 3:57:00 AM Hi, I'm using c# and DOM to try to copy a sub tree (throught XmlNodeList) into another XML document. My Problem is that I don't know how to insert the XmlNodeList once I've selected it. This is my code (my problem is in addNodeList method): public XMLNodeList getNodeList(String XPath) { XMLNodeList nodes=null; try{ nodes=this.xmldoc.SelectNodes(XPath); } catch(Exception e){ this.logError(e.toString()); } return nodes; } public void addNodeList(XMLNodeList nodes, String topNode){ try{ XMLNode newnode=this.xmldoc.createNode(XMLNodeType.Element, topNode); //Here is the problem: I can't insert the whole XmlNodeList with this solution... this.xmldoc.insertAfter(newnode, nodes); } catch(Exception e){ this.logError(e.toString()); } } Am I doing that in the easiest way? Thx in advance for your ideas, solutions. Pierre. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
