all groups > dotnet xml > january 2007 >
You're in the

dotnet xml

group:

XPATH


XPATH Dave Londeck
1/26/2007 12:26:34 PM
dotnet xml:
I am successfully using XPATH to extract a Spreadsheet node from a xml file.
I am now trying to append this element to a different XML file and I am
getting a error stating 'The node to be inserted is from a different
document context.' This is a true statement but I really don't care what
the context is I just need to append a new worksheet to the workbook.

Re: XPATH Martin Honnen
1/26/2007 7:09:40 PM
[quoted text, click to view]

Use the ImportNode method of XmlDocument e.g.
someNode.appendChild(someNode.OwnerDocument.ImportNode(otherNode, true));
that way you can import a node created in one document into another
document.


--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button