Browse through XML tags using QDomElement



I have to parse xml file's with the following format:



<FirstTag>
<SecondTag>
<Attribute value="hello"/>
</SecondTag>
</FirstTag>


Now this is what I have:



QDomNode n = domElem.firstChild();
while(!n.isNull()){
QDomElement e = n.toElement();
if(!e.isNull()){
if(e.tagName() == "FirstTag"){
//secondtag???
}
}
n = n.nextSibling();
}


Now to my actual question: I want to access an attribute from SecondTag, how can I access that, because its a sub tag from FirstTag I cant access it in my current loop.


No comments:

Post a Comment