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

QDomDocument.setContent() silently fails on duplicated attributes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.2.3
    • XML: DOM
    • None
    • Qt 6.2.3 on Mac running version 10.15.7 Catalina of MacOs. Reference environment for comparison: KUbuntu 20.04 with Qt 5.12.8
    • macOS

    Description

      When reading the attached example XML file test_bug.xml with the following code, line 12 with two identical "type" attributes silently stops the processing for the rest of the file (see output log_mac1.xml) and checking the return code of setContent() does not hint that anything went wrong:

       

      xml_.setContent(&file, false, &error_msg, &error_line, &error_column);
      qDebug() << getXml().toString();

      If I comment out this line, the output of toString is as expected (the same as the input, except for the random reordering of the attributes, see output log_mac2.xml). When running this on  Linux with Qt5.12.8, the problem does not appear (ie the whole file is processed in all cases).

       

      Attachments

        1. log_mac1.xml
          0.4 kB
          Mathias Bavay
        2. log_mac2.xml
          1 kB
          Mathias Bavay
        3. test_bug.xml
          1 kB
          Mathias Bavay
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            oyheskes Øystein Heskestad
            bavay Mathias Bavay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h

                Gerrit Reviews

                  There are no open Gerrit changes