PDA

View Full Version : Importing part of QDomDocument into QDomElement



bleze
3rd January 2013, 15:32
I have XML in a QDomDocument. I wish to insert/import everything but the root tag into a QDomElement in another QDomDocument.


QDomNode QDomDocument::importNode ( const QDomNode & importedNode, bool deep )

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!

Santosh Reddy
3rd January 2013, 15:49
You need to import all the immediate children of the root node (not recursively)

bleze
4th January 2013, 07:58
Thank you once again. That helped me in the right direction