Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.7.0
-
None
-
Windows 7 64-bit, Windows 8.1 64-bit, Windows 10 64-bit.
Description
When parsing XML content which has been verified valid by a number of XML validators(including W3C), the following error is seen:
xml error found:Extra content at end of document.
This error is produced by calling XmlStreamReader::errorString() in the following debugging code prior to the actual parsing loop, which calls XmlStreamReader::readNextStartElement():
QXmlStreamReader xml(reply); while (!xml.atEnd()){ if(xml.readNext()) { qDebug() << "xml.name() in readNext loop returns: " + xml.name().toString(); //qDebug() << "xml.tokenString() in readNext returns: " + xml.tokenString(); if(xml.hasError()) { //qDebug() << "xml.errorString() in readNext returns: " + xml.errorString(); qDebug() << "xml.lineNumber() in readNext returns: " + xml.lineNumber(); qDebug() << "xml.columnNumber() in readNext returns: " + xml.columnNumber(); qDebug() << "xml.characterOffset() in readNext returns: " + xml.characterOffset(); qDebug() << "xml error found:" + xml.errorString();
The file which is being parsed has been attached. This problem ONLY happens on Windows OSes(Windows 7 through Windows 10). The same Qt version(5.7.0) with the same file does NOT produce this error and parses fine on Mac OS X.