Archa4
7th February 2011, 09:29
I encountered a strange thing while trying to read xml. I used code that almost anyone used to parse XML. The thing is - i cannot get mine program to read the full XML at once. Instead it reads the page dividing it into parts, and each time it reads the html - it divides it into different parts. Is there anyway to make the program read the xml after it got all the data?
two of many functions I used:
void List::readData(const QHttpResponseHeader &resp)
void List::readData(const QHttpResponseHeader &resp)
{
if (resp.statusCode() != 200)
http.abort();
else
{
xml.addData(http.readAll());
parseXml();
}
}
void List::finished(int id, bool error)
{
if (error)
{
QMessageBox::warning(this, "Error", http.errorString());
}
else if (id == connectionId)
{
}
}
two of many functions I used:
void List::readData(const QHttpResponseHeader &resp)
void List::readData(const QHttpResponseHeader &resp)
{
if (resp.statusCode() != 200)
http.abort();
else
{
xml.addData(http.readAll());
parseXml();
}
}
void List::finished(int id, bool error)
{
if (error)
{
QMessageBox::warning(this, "Error", http.errorString());
}
else if (id == connectionId)
{
}
}