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

QDomDocument: improve the setContent() API

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • None
    • None
    • XML: DOM
    • None
    • 8
    • Team A Foundation Sprint 60, Foundation Sprint 61, Foundation Sprint 62, Foundation Sprint 63

    Description

      QTBUG-104130 requires adding a way of configuring how the whitespace-only text nodes are handled by QDomDocument::setContent(). The natural way of doing it is adding one more parameter to setContent(). Considering that there are 7 overloads of setContent() already, adding one more parameter will require adding 7 more overloads. If we decide to add other options in future (for example invalid data handling option, see QTBUG-104474), the number of overloads will double, so this approach doesn't scale. A cleaner option would be adding a way of passing multiple parse options to setContent() (e.g. via a new ParseOptions type, as suggested by Marc in comments of https://codereview.qt-project.org/c/qt/qtbase/+/415926). Then we could also handle the namespaceProcessing argument via the parse options.

      Other improvements suggested by Marc:

      • Introduce a new Result struct for the output parameters (errorMsg, errorLine, errorColumn)
      • Use QAnyStringView for the string arguments. 

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-104507
          # Subject Branch Project Status CR V

          Activity

            People

              sonakur Sona Kurazyan
              sonakur Sona Kurazyan
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: