Results 1 to 3 of 3

Thread: Importing part of QDomDocument into QDomElement

  1. #1
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Importing part of QDomDocument into QDomElement

    I have XML in a QDomDocument. I wish to insert/import everything but the root tag into a QDomElement in another QDomDocument.

    Qt Code:
    1. QDomNode QDomDocument::importNode ( const QDomNode & importedNode, bool deep )
    To copy to clipboard, switch view to plain text mode 

    does this for me, except I get the root node too. How do I go about excluding root node? Is there an easy way or do I need to parse whole doc recursively?

    Thanks in advance!

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Importing part of QDomDocument into QDomElement

    You need to import all the immediate children of the root node (not recursively)
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

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

    bleze (4th January 2013)

  4. #3
    Join Date
    Jan 2013
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Importing part of QDomDocument into QDomElement

    Thank you once again. That helped me in the right direction

Similar Threads

  1. Replies: 2
    Last Post: 23rd August 2011, 12:23
  2. Importing a QT .pro
    By salmanmanekia in forum Newbie
    Replies: 1
    Last Post: 16th April 2010, 18:17
  3. Split QDomDocument to new QDomDocument
    By estanisgeyer in forum Qt Programming
    Replies: 4
    Last Post: 28th January 2009, 09:59
  4. QDomDocument inside other QDomDocument
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2008, 15:27
  5. QDomElement
    By sabeesh in forum Qt Programming
    Replies: 4
    Last Post: 20th September 2007, 12:55

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.