PDA

View Full Version : XmlStreamreader drives me crazy!!!



pipapongo
12th April 2013, 17:58
hi,
im trying to read the following:
<strengthClass name = "C14">
<roh_k>290</roh_k>
<fm_k>14</fm_k>
<ft0_k>8</ft0_k>
...
...more of theese
</strengthClass>

i tried with:


if (name() == "strengthClass")
{
strengthClass = attributes().value("name").toString();
readNextStartElement();
while(!(this->tokenType() == EndElement && name() == "strengthClass"))
{
if(name() =="roh_k")
{
roh_k = text().toString().toDouble(); // not working
}
else if(name() == "fm_k")
{
fm_k =text().toAscii().toDouble(); // this neither
//...

anda_skoa
12th April 2013, 19:51
readElementText() instead of text()

Cheers,
_

pipapongo
18th April 2013, 09:07
thank you so much :)

it could be so easy....