PDA

View Full Version : Writing to XML overwrite


labbejason
09-02-2009, 01:01 AM
Hey guys,

Everytime I write to an existing xml file, it overwrites all the data. Is there a way to append to the file, or is it the matter of having to read the file, modify or add to the data, then write it back out?

Thanks!

Kameleon
09-02-2009, 01:14 AM
How are you writing the XML file? You need to open the xml, get the node and use .AppendChild

I'll have a look at my snippets.

PEN
09-02-2009, 01:31 AM
Have a look how I'm writing it here. How are you doing it?

http://paulneale.com/tutorials/dotNet/xml/xml.htm

Kameleon
09-02-2009, 01:32 AM
You can do root=XML.FirstChild then root.AppendChild (where XML=dotnetobject "System.Xml.XmlDocument") then just XML.Save... I guess :D

labbejason
09-02-2009, 02:04 AM
You can do root=XML.FirstChild then root.AppendChild (where XML=dotnetobject "System.Xml.XmlDocument") then just XML.Save... I guess :D

Ahh that's where was my mess up :). Thanks Artur!

Appreciate the tutorial, Paul. I've been referencing it time to time.

PEN
09-02-2009, 01:00 PM
I answered so quicky I didn't even notice it was you J. If you need any more example code just let me know.

CGTalk Moderation
09-02-2009, 01:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.