Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dynamic updation of XML file in C++ Application

Dear Experts,

I need some information on dynamic updation of XML file.

Our application asks the user to insert a file by giving the user browsing option.
We want our XML file (which contains the information about the residing files) to be dynamically updated as soon user specifies the path of the inserted file.

The next task is to dynamically update the XML file once the user select the file to be deleted by clicking on the Application UI.

We have to develop the code in C++.

Kindly send across your suggestion, opinion and helpful codes.

Regards,
Mayank Srivastava

Comments

  • zibadianzibadian Member Posts: 6,349
    [b][red]This message was edited by zibadian at 2005-12-12 3:47:48[/red][/b][hr]
    : Dear Experts,
    :
    : I need some information on dynamic updation of XML file.
    :
    : Our application asks the user to insert a file by giving the user browsing option.
    : We want our XML file (which contains the information about the residing files) to be dynamically updated as soon user specifies the path of the inserted file.
    :
    : The next task is to dynamically update the XML file once the user select the file to be deleted by clicking on the Application UI.
    :
    : We have to develop the code in C++.
    :
    : Kindly send across your suggestion, opinion and helpful codes.
    :
    : Regards,
    : Mayank Srivastava
    :
    :
    To update the XML file, read it into the memory and parse it into a tree-structure. Then you can update the tree as you see fit by either removing or inserting nodes. After you have updated the tree, you can save it over the XML file.
    The easiest way to implement this is to create a generic base object for the tree nodes. This should include the memory management of its child nodes, XML tag name, and file I/O. Then you can create descendant objects to implement the satellite data, such as filenames, filepaths, etc.
    As this is the XML development board and not the C++ board, I (not a C++ programmer) cannot give you any code.


  • infidelinfidel Member Posts: 2,900
    : [b][red]This message was edited by zibadian at 2005-12-12 3:47:48[/red][/b][hr]
    : : Dear Experts,
    : :
    : : I need some information on dynamic updation of XML file.
    : :
    : : Our application asks the user to insert a file by giving the user browsing option.
    : : We want our XML file (which contains the information about the residing files) to be dynamically updated as soon user specifies the path of the inserted file.
    : :
    : : The next task is to dynamically update the XML file once the user select the file to be deleted by clicking on the Application UI.
    : :
    : : We have to develop the code in C++.
    : :
    : : Kindly send across your suggestion, opinion and helpful codes.
    : :
    : : Regards,
    : : Mayank Srivastava
    : :
    : :
    : To update the XML file, read it into the memory and parse it into a tree-structure. Then you can update the tree as you see fit by either removing or inserting nodes. After you have updated the tree, you can save it over the XML file.
    : The easiest way to implement this is to create a generic base object for the tree nodes. This should include the memory management of its child nodes, XML tag name, and file I/O. Then you can create descendant objects to implement the satellite data, such as filenames, filepaths, etc.

    You don't want to spend your time writing XML parsers and serializers. You should try to find a library that does that for you. Here's link that may help you get started: http://expat.sourceforge.net/


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

Sign In or Register to comment.