I need to parse file xml I have a link that display
<labels>
<label name="name1">
<description name="name1" url="http:............."/>
<description name="name2" url="http:............."/>
</label>
<label name="name2">
<description name="name1" url="http:............."/>
<description name="name2" url="http:............."/>
</label>
<labels>
and then display it on List. I get the reply of url as xml contain using this method
if (reply) {
if (reply->error() == QNetworkReply::NoError) {
int available = reply->bytesAvailable();
if (available > 0) {
int bufSize = sizeof(char) * available + sizeof(char);
QByteArray buffer(bufSize, 0);
int read = reply->read(buffer.data(), available);
response = QString(buffer);
}
} else {
response =
QString("Error: ") + reply->errorString()
+ QString(" status:")
+ reply->attribute(
QNetworkRequest::HttpStatusCodeAttribute).toString();
}
reply->deleteLater();
}
How I can parse it and display item on list?