Home All Groups Group Topic Archive Search About

Adding XmlNode(s) to an XmlDocument

Author
10 Nov 2005 5:24 AM
SBK
I've got a problem I can't work out - I had a browse on the net and couldn't
find exactly the answer I was after...

How can I add an XmlNode to a loaded XmlDocument? I know I can write an XML
file with XmlTextWriter, but rather than pass the document to simply add one
document and rewrite the entire file, is there a simple way to just add a
node to the document?

..AppendChild looks good, but it needs an XmlNode which I can't create,
because its an abstract class.

If someone can help me out here it's much appreciated. Cheers.

SBK

Author
10 Nov 2005 6:47 AM
Truong Hong Thi
Just use XmlDocument.CreateElement class.

AddThis Social Bookmark Button