Results 1 to 2 of 2

Thread: use QXmlStreamWrite to repair or delete one node.

  1. #1
    Join Date
    Jun 2010
    Posts
    38
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default use QXmlStreamWrite to repair or delete one node.

    Now I use QXmlStreamWrite with qxml, it just can add elements to the file.

    I have not found any way in document to repair or delete one element .

    So Must I use dom to resolve it..?
    Last edited by wookoon; 11th September 2010 at 09:55. Reason: updated contents

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: use QXmlStreamWrite to repair or delete one node.

    You can read the whole document into a QDOMDocument, modify it, and write it back to file. You could also parse the file with SAX (QXmlSimpleReader), modify the relevant parts as you reach them, and write back to another XML file. Which is more suitable depends on what you need to modify, how you need to modify it, and the size of the files. If the input is not well formed XML then you will not be able to use the DOM but you may be able to use SAX.

Similar Threads

  1. Add a picture behind the QTreeView node
    By Raymond in forum Qt Programming
    Replies: 0
    Last Post: 2nd March 2010, 02:55
  2. How to delete a node in treeview?
    By jasonjoy in forum Qt Programming
    Replies: 3
    Last Post: 10th November 2009, 06:07
  3. how to justfy a node is leaf node or not
    By weixj2003ld in forum Qt Programming
    Replies: 4
    Last Post: 9th April 2009, 07:40
  4. Replies: 4
    Last Post: 19th February 2009, 11:10
  5. remove node in xml file
    By mattia in forum Newbie
    Replies: 1
    Last Post: 6th March 2008, 13:25

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.