Re: AppendChild of diff document
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Mon, 12 Feb 2007 19:04:40 +0100
Praveen wrote:
Trying to select a node 'E' from XML document 'ParentXML' and append the same to another xml document 'ChildXML'
string MyXMLStr="<R><E A='1'/></R>";
XmlDocument ParentXML= new XmlDocument();
ParentXML.LoadXml(MyXMLStr);
XmlDocument ChildXML = new XmlDocument();
ChildXML.LoadXml("<R/>");
XmlElement tempE = (XmlElement) ParentXML.DocumentElement.SelectSingleNode ("E");
ChildXML.DocumentElement.AppendChild(tempE);
You need to use ImportNode
ChildXML.DocumentElement.AppendChild(ChildXML.ImportNode(tempE, true));
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.
- References:
- AppendChild of diff document
- From: Praveen
- AppendChild of diff document
- Prev by Date: Manifest Files & VS2005
- Next by Date: Re: c# app to check web status...
- Previous by thread: AppendChild of diff document
- Next by thread: Manifest Files & VS2005
- Index(es):
Relevant Pages
|