Yes it is the same timestamp. I have the date in two locations. On the first page it is correct and on the full list page it is off.
How would you put the xml file into the vector? All code examples I have found look like this:
while(!xml.atEnd() && !xml.hasError())
{
/* Read next element.*/
QXmlStreamReader::TokenType token = xml.readNext();
/* If token is just StartDocument, we'll go to next.*/
if(token == QXmlStreamReader::StartDocument)
continue;
/* If token is StartElement, we'll see if we can read it.*/
if(token == QXmlStreamReader::StartElement) {
if(xml.name() == "email") {
ui->listWidget->addItem("Element: "+xml.name().toString());
continue;
}
}
}
/* Error handling. */
if(xml.hasError())
//resets its internal state to the initial state.
xml.clear();
}
while(!xml.atEnd() && !xml.hasError())
{
/* Read next element.*/
QXmlStreamReader::TokenType token = xml.readNext();
/* If token is just StartDocument, we'll go to next.*/
if(token == QXmlStreamReader::StartDocument)
continue;
/* If token is StartElement, we'll see if we can read it.*/
if(token == QXmlStreamReader::StartElement) {
if(xml.name() == "email") {
ui->listWidget->addItem("Element: "+xml.name().toString());
continue;
}
}
}
/* Error handling. */
if(xml.hasError())
QMessageBox::critical(this, "QXSRExample::parseXML", xml.errorString(), QMessageBox::Ok);
//resets its internal state to the initial state.
xml.clear();
}
To copy to clipboard, switch view to plain text mode
So if I go through the XML one by one I could also stop when I found what I was looking for without putting all elements into the vector.
Bookmarks