Results 1 to 2 of 2

Thread: Problem in QDom xml

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem in QDom xml

    Hi,
    I am facing problem in XML file updation.
    How to replace one line or insert new line in existing XML file without overwriting whole file, using QDomDocument and QFile. I had tried to replace a line in xml file with new line(new line size is less than original line size). But the extra chars from original line are not deleted.


    Please help Thanks in advance.
    "Behind every great fortune lies a crime" - Balzac

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem in QDom xml

    You can't. The concept of files used in current computer systems dictates that you can't insert new data in the middle of the file. To do that you need to overwrite all the following bytes. The same happens when the file gets shorter -- you need to overwrite the contents until the very end and then truncate the rest of the file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    wagmare (20th March 2012)

Similar Threads

  1. qdom xml update
    By RenanBS in forum Newbie
    Replies: 0
    Last Post: 12th October 2010, 21:53
  2. QDom & xhtml
    By Potch in forum Newbie
    Replies: 3
    Last Post: 19th February 2010, 23:41
  3. XML editing with QDom
    By trulysachin in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2008, 16:39
  4. QDom
    By mickey in forum General Programming
    Replies: 9
    Last Post: 17th September 2007, 16:12
  5. parsing using QDOM
    By aruna in forum Qt Programming
    Replies: 1
    Last Post: 17th July 2007, 12:46

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.