elcuco
6th January 2006, 10:26
I am writing an applications which uses a lot of XML for it's input. Until now I have been using QDomNode, and now I saw that there is a QDomElement class which can be used as well. I see that QDomElement is more suitable for me, since I can query it's sub childs
QDomElement::elementsByTagName() but this still returns to me a QDomNode list, which in turn can be converted to elements.
My question is why there is this separation between elements and nodes? Is it really needed? This just makes my code lines way larger.... :)
edit:
Lets give you an example of those monstrosities:
e.start = node.toElement().elementsByTagName("start-regex").item(0).toElement().text();
QDomElement::elementsByTagName() but this still returns to me a QDomNode list, which in turn can be converted to elements.
My question is why there is this separation between elements and nodes? Is it really needed? This just makes my code lines way larger.... :)
edit:
Lets give you an example of those monstrosities:
e.start = node.toElement().elementsByTagName("start-regex").item(0).toElement().text();