[Qt-interest] complete QDomNode to QString
Jason H
scorp1us at yahoo.com
Wed Apr 20 16:54:36 CEST 2011
You don't use element text,take the fce, add it to a new QDomDocument, and use
the ToString() on QDomDocument.
----- Original Message ----
From: Eckhard Jokisch <e.jokisch at orange-moon.de>
To: qt-interest at trolltech.com
Sent: Wed, April 20, 2011 10:40:26 AM
Subject: [Qt-interest] complete QDomNode to QString
Hi,
I have the following XML-data in a QDomDocument:
<THE-VALUE>
<foo-xhtml:h1>
This is an object.
</foo-xhtml:h1>
</THE-VALUE>
Now I want to have
"<foo-xhtml:h1>
This is an object.
</foo-xhtml:h1>"
in a QString to pass it on to a QWebView which should show this as a heading.
This is what I tried but it only stores "This is an object" in QString value:
QDomNode node; //node contains the parent node of "<THE-VALUE>
QString value;
value=node.firstChildElement("THEVALUE").firstChild().toElement().text();
How do I get the "foo-xhtml:h1" tag also into the string?
Thanks in advance
Eckhard
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list