Qt-interest Archive, March 2008
QXmlQuery and "decode" tags (Qt-4.4.0-beta)
Message 1 in thread
Hi,
I have a simple xml file
<?xml version="1.0" encoding="UTF-8"?>
<test>
<a>bbb</a>
</test>
and for that I start a xquery which result is evaluated to a QStringList:
QFile file("test.xml");
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
{
QXmlQuery query;
query.bindVariable("myDocument", &file);
query.setQuery("declare variable $myDocument external; for $i in
doc($myDocument)/test return $i");
QStringList list;
query.evaluateToStringList(&list);
qWarning() << list;
}
Unfortunately the result is ("ÉbbbA"). The tags <a> and </a> are
strange encoded(?)
How can I receive ("<a>bbb</a>")?
Thanks,
Lykurg