chage this:
QDomNode n = doc.firstChild();
To copy to clipboard, switch view to plain text mode
to this:
QDomElement e
= doc.
documentElement();
// now e contains "Node" - it's a document element - means root element
QDomElement e = doc.documentElement(); // now e contains "Node" - it's a document element - means root element
To copy to clipboard, switch view to plain text mode
and use QDomElements if you want to get only elements. You can iterate through "Node" childs like this:
while (!child.isNull()) {
// do sth with child
// it should be "Input" in first iteration and "Output" in second one
child = child.nextSiblingElement(); // move 'child' to be the next sibling element
}
QDomElement child = e.firstChildElement();
while (!child.isNull()) {
// do sth with child
// it should be "Input" in first iteration and "Output" in second one
child = child.nextSiblingElement(); // move 'child' to be the next sibling element
}
To copy to clipboard, switch view to plain text mode
Bookmarks