How can I Update Xml files with QT ?
-
I want to write new values to some tags in an xml files. How can I do that ?
-
You are asking quite a general question. However, there are several "Qt xml examples":http://doc.qt.nokia.com/4.7/examples-xml.html available.
-
I will be more specific:
For example - I want to update (real update - on the file) one attribute value on one tag in an xml file.
How can i do this ? -
I have not done it myself yet with Qt, but the "QDomDocument":http://doc.qt.nokia.com/4.7/qdomdocument.html seem to be a candidate to start with. The xml I have output was not very sophisticated. I have handled with ofstream.
For more complex things the DOM document is in my opinion one option.
There are the QXmlStreamReader and QXmlStreamWriter classes.