PDA

View Full Version : How to store QSlider position Value into .txt file?



YDYD
1st July 2014, 06:49
Hi all,

I would like to get my Qslider position value and store in a txt file. i did as following, my i could not obtain any value.


int h_slide1 = ui->hueSlide1->value();
QFile valueHSV("/home/pi/valueHSV/hsv.txt")
if(!valueHSV.open(QIODevice::WriteOnly| QIODevice::Text))
return;
QTextStream hsv(&valueHSV);
hsv << h_slide1;

is this code correct?

anda_skoa
1st July 2014, 08:25
That looks about right.
Did the QFile::open() work?

Cheers,
_

YDYD
1st July 2014, 09:07
this can make file without error,

Will this store a value in a txt file that after i drag the slider? after i close the GUI,
i will can open the text file to see my slider value,
am i correct?
but the txt file is blank.

YDYD
1st July 2014, 09:20
Regarding above title, i am doing a GUI to filter out the colour i do not want,
I would like to get value of H, S and V using slider and store these value inside a .txt file.
After that i would call these value into another function to processing and show a filter stream video,
I did use QFile and QTextStreamer, but could not get through.

Here is a photo of my GUI,
10490
Please advise,

Lesiok
1st July 2014, 09:35
Value in file will be stored after the code execution. Question : how You activate this code ?

YDYD
1st July 2014, 09:54
Hi,
I just simply build & Run it,
i create another thread here : http://www.qtcentre.org/threads/59647-How-to-store-QSlider-position-Value-into-txt-file

yeye_olive
1st July 2014, 10:01
Please do not create other threads, this only pollutes the forum. Focus on giving as much information as you can, so that we can help you effectively.

So far we have only seen a snippet of code, but we have no idea when it is executed. This may be dead code for all we know. Have you run a debugger and witnessed your snippet being executed? Another important question: what are the lifetimes of the QTextStream and QFile variables?

It would help if you posted the whole source of a minimal program reproducing the problem.

YDYD
1st July 2014, 11:02
I am so sorry for that.
i am doing a GUI to filter out the colour i do not want,
I would like to get value of H, S and V using slider and store these value inside a .txt file.
After that i would call these value into another function to processing and show a filter stream video,
I did use QFile and QTextStreamer, but could not get through.
below is my code


//getCam.pro
################################################## ####################
# Automatically generated by qmake (2.01a) Tue Jun 24 17:53:36 2014
################################################## ####################
CONFIG += console

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .

# Input
HEADERS += dialog.h
FORMS += dialog.ui
SOURCES += dialog.cpp main.cpp

//main.cpp
#include <QApplication>
#include "dialog.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Dialog w;
w.show();

return a.exec();
}


//dialog.h
#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>

#include "opencv/cv.h"
#include "opencv/highgui.h"
#include <QTimer>
#include <QPixmap>

namespace Ui
{
class Dialog;
}

class Dialog : public QDialog
{
Q_OBJECT

public:
explicit Dialog(QWidget *parent = 0);
~Dialog();

private:
Ui::Dialog *ui;

CvCapture *cam;
IplImage *frame,*imgHSV;

QTimer *timer;

private slots:
void getFrame();
void prcFrame();
void getValue();
};

#endif // DIALOG_H


//dialog.cpp
#include "dialog.h"
#include "ui_dialog.h"

#include <QDebug>
#include <QFile>
#include <QTextStream>

Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);

timer = new QTimer(this);

cam = cvCaptureFromCAM(-1);

if(cam==NULL)
qDebug()<<"error";

timer->start(30);
connect(timer,SIGNAL(timeout()),this,SLOT(getFrame ()));
}

void Dialog::getFrame()
{
frame = cvQueryFrame(cam);
QImage image = QImage ((const uchar*)frame->imageData,frame->width,frame->height,QImage::Format_RGB888).rgbSwapped();//rgbSwapped() make color better
ui->original->setPixmap(QPixmap::fromImage(image));
}

void Dialog::prcFrame()
{
imgHSV= cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_8U,3);
cvCvtColor(frame,imgHSV,CV_BGR2HSV);

//threshed , get value from slider value
// QImage filterImg = QImage ((const uchar*)imgHSV->imageData,imgHSV->width,imgHSV->height,QImage::Format_RGB888);
// ui->filter->setPixmap(QPixmap::fromImage(filterImg));
}

void Dialog::getValue()
{
int h_slide1 = ui->hueSlide1->value();
QFile valueHSV("/home/pi/valueHSV/hsv.txt");
if(!valueHSV.open(QIODevice::WriteOnly|QIODevice:: Text))
{
qDebug() << "cannot open file for writing"<<endl;
return;
}
QTextStream hsv(&valueHSV);
hsv <<h_slide1;
qDebug() << "Value=" << h_slide1;
valueHSV.close();

}


Dialog::~Dialog()
{
timer->stop();
cvReleaseCapture(&cam);

delete ui;
}




//compile output
04:45:50: Running steps for project getCam...

04:45:50: Configuration unchanged, skipping qmake step.

04:45:50: Starting: "/usr/bin/make" -w

make: Entering directory `/home/pi/qt/getCam'

/usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ -o Makefile getCam.pro

make: Leaving directory `/home/pi/qt/getCam'

make: Entering directory `/home/pi/qt/getCam'

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -I/usr/local/include/opencv -o dialog.o dialog.cpp

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -I/usr/local/include/opencv -o main.o main.cpp

/usr/bin/moc-qt4 -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -I/usr/local/include/opencv dialog.h -o moc_dialog.cpp

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -I/usr/local/include/opencv -o moc_dialog.o moc_dialog.cpp

g++ -Wl,-O1 -o getCam dialog.o main.o moc_dialog.o -L/usr/lib/arm-linux-gnueabihf /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_imgproc.so -lQtGui -lQtCore -lpthread

make: Leaving directory `/home/pi/qt/getCam'

04:47:35: The process "/usr/bin/make" exited normally.

and this is the pic of GUI design
10491

Please advise

regards
YDYD

anda_skoa
1st July 2014, 12:21
Could you point out where you call getValue()? I can't seem to find it.

Cheers,
_

YDYD
1st July 2014, 13:27
Hi,
I didn't call getValue()...
By right, there should be a connect() in dialog.cpp, but i deleted,
and getValue() is to act as a SLOT?

I not really know how to use it....
Do i need another .cpp and .h file for "on_horizontalSlider_valueChanged()"?

Added after 45 minutes:

i just test my code using timer as my signal,

connect(timer,SIGNAL(timeout()),this,SLOT(getValue ()));
I was able to get Value and in text file too!

but, i would like to change only when slider is move, what should i put as SIGNAL?

Regards
YDYD

anda_skoa
1st July 2014, 14:08
The slider has a valueChanged signal (declared in QAbstractSlider).



connect(ui->hueSlide1, SIGNAL(valueChanged(int)), this, SLOT(getValue()));


Cheers,
_

yeye_olive
1st July 2014, 17:12
There is a problem at line 55 in dialog.cpp:

valueHSV.close();
This closes the file even though the QTextStream hsv may still have bytes in its internal buffer that have not been written to the file. You can fix the issue by removing this line. When the function exits, the variables on the stack are destroyed in reverse order of construction. That means that hsv is destroyed before valueHSV. When hsv is destroyed, it flushes its buffer (see QTextStream::~QTextStream()), writing any unwritten bytes to the (still open) file. Then valueHSV is destroyed, and is closed and flushed to disk automatically in the process (see QFile::~QFile()).

YDYD
2nd July 2014, 02:12
Thank to anda_skoa and yeye_olive remind,
in my text file i get the value once i move the slider!


qDebug() << "Value=" << h_slide1;

in my text file only have value, what if i need "Value = XX" inside of my text file?
Is this achievable ?

Added after 12 minutes:

I have solved this myself, thank you all,

another question is, can i output as XML format?

YDYD
2nd July 2014, 04:02
my dialog.cpp end up like this..


#include "dialog.h"
#include "ui_dialog.h"

#include <QDebug>
#include <QFile>
#include <QTextStream>

Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);

timer = new QTimer(this);

cam = cvCaptureFromCAM(-1);

if(cam==NULL)
qDebug()<<"error";

timer->start(30);
connect(timer,SIGNAL(timeout()),this,SLOT(getFrame ()));

connect(ui->hueSlide1,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->hueSlide2,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->satSlide1,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->satSlide2,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->lumSlide1,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->lumSlide2,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
}

void Dialog::getFrame()
{
frame = cvQueryFrame(cam);
QImage image = QImage ((const uchar*)frame->imageData,frame->width,frame->height,QImage::Format_RGB888).rgbSwapped();//rgbSwapped() make color better
ui->original->setPixmap(QPixmap::fromImage(image));
}

void Dialog::prcFrame()
{
imgHSV= cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_8U,3);
cvCvtColor(frame,imgHSV,CV_BGR2HSV);

//threshed , get value from slider value
// QImage filterImg = QImage ((const uchar*)imgHSV->imageData,imgHSV->width,imgHSV->height,QImage::Format_RGB888);
// ui->filter->setPixmap(QPixmap::fromImage(filterImg));
}

void Dialog::saveValue()
{
int h_slide1 = ui->hueSlide1->value();
int h_slide2 = ui->hueSlide2->value();
int s_slide1 = ui->satSlide1->value();
int s_slide2 = ui->satSlide2->value();
int l_slide1 = ui->lumSlide1->value();
int l_slide2 = ui->lumSlide2->value();
QFile valueHSV("/home/pi/valueHSV/hsv.txt");
if(!valueHSV.open(QIODevice::WriteOnly|QIODevice:: Text))
{
qDebug() << "cannot open file for writing"<<endl;
return;
}
QTextStream hsv(&valueHSV);
hsv << "<HUE LOW>" <<h_slide1<<endl;
hsv << "<HUE HIGH>" <<h_slide2<<endl;
hsv << "<SAT LOW>" <<s_slide1<<endl;
hsv << "<SAT HIGH>" <<s_slide2<<endl;
hsv << "<LUM LOW>" <<l_slide1<<endl;
hsv << "<LUM HIGH>" <<l_slide2<<endl;
//qDebug() << "H_low" << h_slide1;
//qDebug() << "H_high" << h_slide2;
//valueHSV.close();

}

Dialog::~Dialog()
{
timer->stop();
cvReleaseCapture(&cam);

delete ui;
}

if i would like to read the value from the txt file and send back to the slider, is it possible?

YDYD
2nd July 2014, 06:11
I have added in a new connect , which is when LOAD button is clicked, i can get my the value from txt file which is from loadValue() function, but I could not obtain it,
I did not get debug message from this function too,
please advise where i did wrong,

By the way, i would like to get Integer value only, i don't want the words.


#include "dialog.h"
#include "ui_dialog.h"

#include <QDebug>
#include <QFile>
#include <QTextStream>

Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);


timer = new QTimer(this);

cam = cvCaptureFromCAM(-1);

if(cam==NULL)
qDebug()<<"error";

timer->start(30);
connect(timer,SIGNAL(timeout()),this,SLOT(getFrame ()));

connect(ui->hueSlide1,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->hueSlide2,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->satSlide1,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->satSlide2,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->lumSlide1,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->lumSlide2,SIGNAL(valueChanged(int)),this,SLOT(save Value()));
connect(ui->load,SIGNAL(clicked()),this,SLOT(loadValue()));
}

void Dialog::getFrame()
{
frame = cvQueryFrame(cam);
QImage image = QImage ((const uchar*)frame->imageData,frame->width,frame->height,QImage::Format_RGB888).rgbSwapped();//rgbSwapped() make color better
ui->original->setPixmap(QPixmap::fromImage(image));
}

void Dialog::prcFrame()
{
imgHSV= cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_8U,3);
cvCvtColor(frame,imgHSV,CV_BGR2HSV);

//threshed , get value from slider value
// QImage filterImg = QImage ((const uchar*)imgHSV->imageData,imgHSV->width,imgHSV->height,QImage::Format_RGB888);
// ui->filter->setPixmap(QPixmap::fromImage(filterImg));
}

void Dialog::saveValue()
{
int h_slide1 = ui->hueSlide1->value();
int h_slide2 = ui->hueSlide2->value();
int s_slide1 = ui->satSlide1->value();
int s_slide2 = ui->satSlide2->value();
int l_slide1 = ui->lumSlide1->value();
int l_slide2 = ui->lumSlide2->value();
QFile valueHSV("/home/pi/valueHSV/hsv.txt");
if(!valueHSV.open(QIODevice::WriteOnly|QIODevice:: Text))
{
qDebug() << "cannot open file for writing"<<endl;
return;
}
QTextStream hsv(&valueHSV);
hsv << "<HUE LOW>" <<h_slide1<<endl;
hsv << "<HUE HIGH>" <<h_slide2<<endl;
hsv << "<SAT LOW>" <<s_slide1<<endl;
hsv << "<SAT HIGH>" <<s_slide2<<endl;
hsv << "<LUM LOW>" <<l_slide1<<endl;
hsv << "<LUM HIGH>" <<l_slide2<<endl;
//qDebug() << "H_low" << h_slide1;
//qDebug() << "H_high" << h_slide2;
//valueHSV.close();

}

void Dialog::loadValue()
{
QStringList list;
QFile valueHSV("/home/pi/valueHSV/hsv.txt");
if(!valueHSV.open(QIODevice::ReadOnly|QIODevice::T ext))
{
qDebug() << "cannot open file for reading"<<endl;
return;
}
QTextStream hsv(&valueHSV);
while (!hsv.atEnd())
{
QString load=hsv.readLine();
if(load.isNull())
break;
}
foreach(QString str, list)
{
int h1 = str.toInt();
qDebug() << "value"<<h1;
}
return;
}

Dialog::~Dialog()
{
timer->stop();
cvReleaseCapture(&cam);

delete ui;
}

stampede
2nd July 2014, 06:58
QStringList list;
...
TextStream hsv(&valueHSV);
while (!hsv.atEnd())
{
QString load=hsv.readLine();
if(load.isNull())
break;
}
foreach(QString str, list)
{
....
"list" is always empty, you never add anything to it. I guess you want to do that in the while loop:


TextStream hsv(&valueHSV);
while (!hsv.atEnd())
{
QString load=hsv.readLine();
if(load.isNull())
break;
list << load;
}

YDYD
2nd July 2014, 07:57
QStringList list;
...
TextStream hsv(&valueHSV);
while (!hsv.atEnd())
{
QString load=hsv.readLine();
if(load.isNull())
break;
}
foreach(QString str, list)
{
....
"list" is always empty, you never add anything to it. I guess you want to do that in the while loop:


TextStream hsv(&valueHSV);
while (!hsv.atEnd())
{
QString load=hsv.readLine();
if(load.isNull())
break;
list << load;
}


Hi stampede,
Thanks for your reply, after i deleted the foreach loop, and add
list<<load;

i was able to get all the thing i written into txt file,
but i would like to have the Integer inside txt file only, is it possible?

anda_skoa
2nd July 2014, 08:13
another question is, can i output as XML format?

Sure.

Either create it manually, i.e. writing the XML markup as text, or using QXmlStreamWriter

Cheers,
_

YDYD
2nd July 2014, 10:39
void Dialog::saveValue()
{
int h_slide1 = ui->hueSlide1->value();
int h_slide2 = ui->hueSlide2->value();
int s_slide1 = ui->satSlide1->value();
int s_slide2 = ui->satSlide2->value();
int l_slide1 = ui->lumSlide1->value();
int l_slide2 = ui->lumSlide2->value();
QFile valueHSV("/home/pi/valueHSV/hsv.xml");
if(!valueHSV.open(QIODevice::WriteOnly|QIODevice:: Text))
{
qDebug() << "cannot open file for writing"<<endl;
return;
}
QXmlStreamWriter hsv(&valueHSV);
hsv.setAutoFormatting(true);
hsv.writeStartDocument();
hsv.writeStartElement("HSV");
hsv.writeAttribute("value","hsv");
hsv.writeTextElement("HUE LOW",h_slide1);
hsv.writeTextElement("HUE HIGH",h_slide2);
hsv.writeTextElement("SAT LOW",s_slide1);
hsv.writeTextElement("SAT HIGH",s_slide2);
hsv.writeTextElement("LUM LOW",l_slide1);
hsv.writeTextElement("LUM HIGH",l_slide2);
hsv.writeEndElement();
hsv.writeEndDocument();
valueHSV.close();
/*QTextStream hsv(&valueHSV);
hsv << "<HUE LOW>" <<h_slide1<<endl;
hsv << "<HUE HIGH>" <<h_slide2<<endl;
hsv << "<SAT LOW>" <<s_slide1<<endl;
hsv << "<SAT HIGH>" <<s_slide2<<endl;
hsv << "<LUM LOW>" <<l_slide1<<endl;
hsv << "<LUM HIGH>" <<l_slide2<<endl;*/
//qDebug() << "H_low" << h_slide1;
//qDebug() << "H_high" << h_slide2;
//valueHSV.close();

}

After i change to QXmlStreamWriter

I get error

ERROR MSG:
invalid conversion from 'int' to 'const char*' [-fpermissive]
error: initializing argument 1 of 'QString::QString(const char*)'

Please advise.
Thanks in advance

stampede
2nd July 2014, 10:47
hsv.writeTextElement("HUE LOW",h_slide1);
second argument to "writeTextElement" should be a string, not an integer:


hsv.writeTextElement("HUE LOW",QString::number(h_slide1));

YDYD
2nd July 2014, 10:55
hsv.writeTextElement("HUE LOW",h_slide1);
second argument to "writeTextElement" should be a string, not an integer:


hsv.writeTextElement("HUE LOW",QString::number(h_slide1));


Hi Stampede

thank you for your valuable help,

There is many to change, is there any fast method to change them efficiently?

stampede
2nd July 2014, 11:34
There is many to change, is there any fast method to change them efficiently?
Is the int to string conversion slowing down your application ?

YDYD
2nd July 2014, 12:18
No, but i am porting Visual studio code to QT, there is alot, so i think if there is another way to change it? haha

after i change to QString, How can i change it back to int?? QString::setNum() ?

Added after 15 minutes:


QXmlStreamReader hsv(&valueHSV);
hsv.readNext();
while(!hsv.atEnd())
{
if(hsv.isStartElement())
{
if(hsv.name()=="HSV")
{
if(hsv.name()=="HUE LOW")

ui->hueSlide1->setValue(QString::toInt(hsv.readElementText()));
}
}
}

There is error if i do like this,
please advise

anda_skoa
2nd July 2014, 14:57
toInt() is not a static method, you call it on a QString object.



ui->hueSlide1->setValue(hsv.readElementText().toInt());


Cheers,
_

YDYD
2nd July 2014, 16:11
Thanks for advise! =)

YDYD
3rd July 2014, 03:07
Hi all, here is an update...
I cant read through my xml file,
It stuck at
qDebug<<"reading"; part
continuos printing reading for output...
Please help check if there is any error.


This is saving to xml file, working fine

void Dialog::saveValue()
{
int h_slide1 = ui->hueSlide1->value();
int h_slide2 = ui->hueSlide2->value();
int s_slide1 = ui->satSlide1->value();
int s_slide2 = ui->satSlide2->value();
int l_slide1 = ui->lumSlide1->value();
int l_slide2 = ui->lumSlide2->value();
QFile valueHSV("/home/pi/valueHSV/hsv.xml");
if(!valueHSV.open(QIODevice::WriteOnly|QIODevice:: Text))
{
qDebug() << "cannot open file for writing"<<endl;
return;
}
QXmlStreamWriter hsv(&valueHSV);
hsv.setAutoFormatting(true);
hsv.writeStartDocument();
hsv.writeStartElement("HSV");
hsv.writeTextElement("HUE LOW",QString::number(h_slide1));
hsv.writeTextElement("HUE HIGH",QString::number(h_slide2));
hsv.writeTextElement("SAT LOW",QString::number(s_slide1));
hsv.writeTextElement("SAT HIGH",QString::number(s_slide2));
hsv.writeTextElement("LUM LOW",QString::number(l_slide1));
hsv.writeTextElement("LUM HIGH",QString::number(l_slide2));
hsv.writeEndElement();
hsv.writeEndDocument();
valueHSV.close();


}

this is reading from xml part...

void Dialog::loadValue()
{
//QStringList list;
QFile valueHSV("/home/pi/valueHSV/hsv.xml");
if(!valueHSV.open(QIODevice::ReadOnly|QIODevice::T ext))
{
qDebug() << "cannot open file for reading"<<endl;
return;
}
else
{
QXmlStreamReader hsv(&valueHSV);
while(!hsv.atEnd())
{qDebug()<<"reading";
if(hsv.isStartElement())
{
qDebug()<<"here";
if(hsv.name()=="HSV")
{qDebug()<<"now";
if(hsv.name()=="HUE LOW")
{
ui->hueSlide1->setValue(hsv.readElementText().toInt());
qDebug()<<"1";
}
if(hsv.name()=="HUE HIGH")
{
ui->hueSlide2->setValue(hsv.readElementText().toInt());
}
if(hsv.name()=="SAT LOW")
{
ui->satSlide1->setValue(hsv.readElementText().toInt());
}
if(hsv.name()=="SAT HIGH")
{
ui->satSlide2->setValue(hsv.readElementText().toInt());
}
if(hsv.name()=="LUM LOW")
{
ui->lumSlide1->setValue(hsv.readElementText().toInt());
}
if(hsv.name()=="LUM HIGH")
{
ui->lumSlide2->setValue(hsv.readElementText().toInt());
}
}

}
}
}valueHSV.close();

}

Please advise.

Thanks in advance
Best Regards
YDYD

anda_skoa
3rd July 2014, 10:17
Your reading code is not doing any reading :)

You need to advance in the stream by telling the stream reader to read.
E.g. calling readNext() or in you case probably easier just calling readNextStartElement()

Cheers,
_