hi,
I am using xmlstreamreader and xmlstreamwriter to save the read the data. now i want to edited and update the data.
Is this possibe with xmlstream ? Is there feature in XMl Stream?
hi,
I am using xmlstreamreader and xmlstreamwriter to save the read the data. now i want to edited and update the data.
Is this possibe with xmlstream ? Is there feature in XMl Stream?
Personally I havn't done any XML with Qt sofar, but from the looks of it, you might want to have a look at QDomDocument and the examples there.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
XMLStream reader and writer are nice for reading document from string and writing it back. For editing xml it is better to use QDomDocument, which loads whole XML into memory as its own data structure which you can traverse and modify with QDom classes and methods. Then after modifications you can write it back.
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
Using DOM, you can load the entire XML into memory at one time, make changes, then write the changes back. If you use a stream, then I suppose that while you are reading the text, you write the unchanged portion until you arrive at the portion that should be changed, write the changed section, then write the rest.
Which you use is directly related to the method that works best for how you work. If you intend to read the entire thing into memory before writing, DOM feels like the better choice.
Bookmarks