Writing and saving a XML file?
-
Hello,everyone! I have a question about operating XML file. I need to open a XML file which was a template when the application run, after I've input in TextboxA, the XML file could be saved as a new file in one folder. Then open the saved file again and other Textboxes' text will be written in its elements. (In text_changed event). My question is : I know how to open and save a XML file, but after I save it ,if I want to write new text in it , I need to load the file again? When I write all text in XML, it would need open--write--save and repeat much times ?I think it is so fool…… So,could you give me some suggestions or help? Maybe I should use thread? But there are so much controls :sigh: Thanks !
-
Hello,everyone! I have a question about operating XML file. I need to open a XML file which was a template when the application run, after I've input in TextboxA, the XML file could be saved as a new file in one folder. Then open the saved file again and other Textboxes' text will be written in its elements. (In text_changed event). My question is : I know how to open and save a XML file, but after I save it ,if I want to write new text in it , I need to load the file again? When I write all text in XML, it would need open--write--save and repeat much times ?I think it is so fool…… So,could you give me some suggestions or help? Maybe I should use thread? But there are so much controls :sigh: Thanks !
No once you open the XML file original, load it into an in memory object, make all the changes, and write out to file, keep making more changes to the internal memory object, and write out the changes when you want to persist to file.
Dave Find Me On: Web|Facebook|Twitter|LinkedIn CPRepWatcher now available as Packaged Chrome Extension, visit my articles for link.
-
No once you open the XML file original, load it into an in memory object, make all the changes, and write out to file, keep making more changes to the internal memory object, and write out the changes when you want to persist to file.
Dave Find Me On: Web|Facebook|Twitter|LinkedIn CPRepWatcher now available as Packaged Chrome Extension, visit my articles for link.