work with web generated xml
Hello,
I need to work with web generated xml document. If I work with local disk file, everithing's fine:
Code:
...
cout << "chyba!";
return;
}else{
cout << "soubor otevren...";
read(&file);
}
file.close();
...
You see, I send to method read pointer to file (QIODevice). I want to do something like this:
Code:
...
if(!address.
open(QFile::ReadOnly |
QFile::Text)) { cout << "chyba!";
return;
}else{
cout << "soubor otevren...";
read(&address);
}
...
Of course I know, it's wrong. I found only QDesktopServices::openUrl ( const QUrl & url ) but it opens URL in web browser and I don't want this! I need to work with generated xml file.
It crossed my mind that I can save generated document to disk and then can I work with that like I want to. But I think it's soo complicated.
Thx for any answer...
Re: work with web generated xml
Hello,
can anyone help me, with my problem? I have this code:
Code:
#include <iostream>
#include <QApplication>
#include <QIODevice>
#include <QFile>
#include <QTextStream>
#include <QUrl>
#include <QtNetwork>
#include <QHttp>
#include <QObject>
int main(int argc, char *argv[]){
http->setHost("www.trolltech.com");
out << http->errorString() << endl;
http
->get
(QUrl::toPercentEncoding("/index.html"),
file);
out << http->errorString() << endl;
file->close();
return 0;
}
And the result is:
Unknown error
Unknown error
I tried many different versions of code, but the result is still that :( Know anybody what can by wrong?
Thx for all answers...