mehmetozer
mehmetozer

Reputation: 858

How to return to Root Element in QDomDocument ?

I am currently working on QDomDocument and I want to implement several functions but I want to use just one QDomDocument. So to do that while working I need to return to Root value sometimes. For example I have an XML like this ;

<Root>
  <Node A>
    <Node B>
    <\Node B>
   <\Node A>
 <Root>

And think that I am working on Node B, but what should I do to return ?

Can you please tell me how I can back to root value using QDomDocument ?

Thank you very much

Upvotes: 2

Views: 1753

Answers (1)

Nick Dandoulakis
Nick Dandoulakis

Reputation: 43110

That's easy. documentElement() returns the root element.

QDomElement QDomDocument::documentElement () const

Returns the root element of the document.

Upvotes: 3

Related Questions