Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
4.5.2
-
None
-
MacBook Pro
Windows Vista
Microsoft Visual Studio 2008
Description
Saving a QDomDocument to file sometimes results in its elements' attributes being reordered.
e.g. the XML attributes in this QString:
<root name="fred"> <element1 c="a" d="b" f="c"/ > </root>
get reordered to:
<root name="fred" > <element1 f="c" c="a" d="b" /> </root>
The following code demonstrates:
QString xml = "<root name=\"fred\"><element1 c=\"a\" d=\"b\" f=\"c\"/></root>"; QDomDocument* domDoc = new QDomDocument; domDoc->setContent(xml, false); QFile file("temp.xml"); if(!file.open(QFile::WriteOnly)) return; QTextStream out(&file); domDoc->save(out, 3);
See also Qt bug 5364. The patch looks specific to that problem though.
Attachments
Issue Links
- is required for
-
QTBUG-5364 QDomDocument::toString() generated file doesn't parse properly
- Closed
- relates to
-
QTBUG-76800 Option to sort attributes in QDomDocument::toString()
- Reported
-
QTBUG-25071 tst_QDom relies on specific QHash ordering
- Closed