Click to See Complete Forum and Search --> : Add, modify and xml file using C++ (DOM)


gh0st
October 5th, 2004, 11:31 AM
Dear All,

Using C++ (DOM), I have designed a class where it can create an xml file with a certain structure. Now I have another class that loads this xml file, but currently stuck to add or modify child nodes to this xml file without the need to create the structure all over again.

Please help, I am stuck for the last 3 days :(

Many thnx

DVDcontrol
October 6th, 2004, 06:19 PM
The obvious way to do this is to derive your new class for the original class (use the 'is-a' relationship). That way the structure can be re-used.

Your instance of the new class can then also be used to create the data. Just remember to reset the data before loading from a saved file.

Ejaz
October 7th, 2004, 07:03 AM
I don't know that whether its suits ur requirements, but have a look at A Simple DOM-Based XML Manager Class (http://www.codeguru.com/Cpp/data/data-misc/xml/article.php/c8287/)