Append XML string block WITH NAMESPACE REF to existing XmlDocument in .NET
- by FT
I have an xml document (XmlDocument) which looks like this...
<stuff xmlns:n="hhtp://tempuri.com/">
</stuff>
... and a "fragment" (string) which looks like this
<things>
<thing n:type="info">
</thing>
</things>
I want to "inject" the fragment into the main document.
How?
(HINT: You can't use XmlDocumentFragment because the namespace 'n' isn't declared in the fragment, and the object model complains about this - throwing an 'unknown namespace' error even though the resultant document will be perfectly valid.)