?
=?ISO-8859-15?Q?Martin_P=F6pping?=
Hello,
I want to add some elements of one XmlDocument in another.
My code looks like this:
XmlDocument docA= new XmlDocument();
docA.LoadXml(record);
XmlNodeList nl = docA.SelectNodes("/search/recordlist/record");
XmlNode recordlist = docB.FirstChild;
foreach (XmlNode node in nl)
{
recordlist.AppendChild(node);
}
But these lines of code do not work,
because the compiler tells me:
"The node to be inserted is from a different document context."
How can I solve this problem?
Regards,
Martin
I want to add some elements of one XmlDocument in another.
My code looks like this:
XmlDocument docA= new XmlDocument();
docA.LoadXml(record);
XmlNodeList nl = docA.SelectNodes("/search/recordlist/record");
XmlNode recordlist = docB.FirstChild;
foreach (XmlNode node in nl)
{
recordlist.AppendChild(node);
}
But these lines of code do not work,
because the compiler tells me:
"The node to be inserted is from a different document context."
How can I solve this problem?
Regards,
Martin