summaryrefslogtreecommitdiffstats
path: root/src/xml/dom/qdomhelpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml/dom/qdomhelpers.cpp')
-rw-r--r--src/xml/dom/qdomhelpers.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/xml/dom/qdomhelpers.cpp b/src/xml/dom/qdomhelpers.cpp
index 62258fbdfd..0649e0c75d 100644
--- a/src/xml/dom/qdomhelpers.cpp
+++ b/src/xml/dom/qdomhelpers.cpp
@@ -8,6 +8,7 @@
#include "qdomhelpers_p.h"
#include "qdom_p.h"
#include "qxmlstream.h"
+#include "private/qxmlstream_p.h"
#include <memory>
#include <stack>
@@ -264,9 +265,9 @@ bool QDomParser::parseProlog()
if (reader->isStandaloneDocument()) {
value += u" standalone='yes'"_s;
} else {
- // TODO: Add standalone='no', if 'standalone' is specified. With the current
- // QXmlStreamReader there is no way to figure out if it was specified or not.
- // QXmlStreamReader needs to be modified for handling that case correctly.
+ // Add the standalone attribute only if it was specified
+ if (reader->hasStandaloneDeclaration())
+ value += u" standalone='no'"_s;
}
if (!domBuilder.processingInstruction(u"xml"_s, value)) {