update XML file dynamically
-
Hai Good Morning... I need to update the xml file dynamically in vc++. i did parsing to the xml file then i displaying the parsed values in treectrl. now i am goin to edit the values in the ctrl...which means i will rename the values or deleting the values if i did these changes in treectrl i need to update the same values in XML file also.... any idea.... pls reply me
-
Hai Good Morning... I need to update the xml file dynamically in vc++. i did parsing to the xml file then i displaying the parsed values in treectrl. now i am goin to edit the values in the ctrl...which means i will rename the values or deleting the values if i did these changes in treectrl i need to update the same values in XML file also.... any idea.... pls reply me
Hi, I think that you should create DOM tree for your XML file and show it tree control. When you update anything in tree control, you should automatically update data in you DOM document. When you finish your changes (before you close your application, for example) you'll simple save DOM document. That's all. But if you have so big XML file this is not a good idea. You should use SAX to load you document and you should generate new XML file when you save changes. I used these things in C#, but I think that there are some equivalents in C++. For example, I can recommend you Xerces. This is good cross-platform C++ library.