Priority: P3: Somewhat important
Affects Version/s: 4.5.3
Fix Version/s: None
Component/s: XML: DOM
When using QDomDocument::toString() to generate XML files, some attributes order are incorrect. As a result, when parsing the generated XML file, the namespaceURI is not properly set.
Qt is generating xml that looks like this:
<element test:my-attribute="true" xmlns:test="my:test:uri" />,
Since the xmlns:test declaration is coming after the usage of the test namespace, the my-attribute QAttrNode isn't getting its namespaceURI set.
Reversing the things: <element xmlns:test="my:test:uri" test:my-attribute="true" /> and this parses fine.
The following test program reproduces the problem:
The customer also provided a candidate patch: