Results 1 to 4 of 4

Thread: Xml stream

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Xml stream

    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):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  2. #2
    Join Date
    Jan 2010
    Posts
    73
    Thanks
    6
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Xml stream

    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.

Similar Threads

  1. QHttp file upload doesn't stream?
    By haughki in forum Qt Programming
    Replies: 9
    Last Post: 21st October 2009, 20:42
  2. Non-blocking stream read
    By akiross in forum Qt Programming
    Replies: 3
    Last Post: 16th April 2009, 11:07
  3. How can we convert video stream to QPixmap?
    By learning_qt in forum Qt Programming
    Replies: 1
    Last Post: 9th September 2008, 23:44
  4. QGraphicScene to stream
    By phannent in forum Newbie
    Replies: 2
    Last Post: 28th June 2008, 09:43
  5. QFile stream to SDL_mixer
    By doitux in forum Qt Programming
    Replies: 9
    Last Post: 2nd June 2007, 14:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.