Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
None
-
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
- is required for
-
QTBUG-104130 QDomDocument::setContent() with QXmlStreamReader discards whitespace-only Text nodes
-
- Closed
-
-
QTBUG-89690 Functions and classes that allow to get whitespace-only text nodes are deprecated without any alternatives
-
- Closed
-
-
QTBUG-90003 Add a means to allow whitespace to be preserved when using QDomDocument
-
- Closed
-