Solved QtXml: How to read text of element from xml file.
-
Hello everyone,
I want to read text of element for example:
<state-space> xyz </state-space>
I want to read "xyz" from the above example. I already read element but dont know how to read text from element.
Many Thanks,
-
@ShrikantAmbade Hi! I guess you're using
QXmlStreamReader
. Is this correct? -
@Wieland No, I am using QDomDocument
-
Ok. So you already got the QDomElement that contains "state-space". You can get the text of that element using
QString QDomElement::text() const
. See: http://doc.qt.io/qt-5/qdomelement.html#text -
@Wieland Thank you so much :)