Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57397

QXmlStreamReader produces malformed errors on well formed XML files

    XMLWordPrintable

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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            mark_in_gr Mark C
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes