P
Praveen
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);
throws 'The node to be inserted is from a different document context.'
error.
Can I use Clone() or CloneNode() to achieve this.
A sample will be usefull.
hanks,
praveen
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);
throws 'The node to be inserted is from a different document context.'
error.
Can I use Clone() or CloneNode() to achieve this.
A sample will be usefull.
hanks,
praveen