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

QDomDocument.setContent() silently fails on duplicated attributes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • 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. test_bug.xml
          1 kB
        2. log_mac2.xml
          1 kB
        3. log_mac1.xml
          0.4 kB

        Activity

          People

            Unassigned Unassigned
            bavay Mathias Bavay
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: