I’m working with QDomElement and QDomDocument to export data to XML. When I do this, the attributes get written in the correct order:
element.setAttribute("xRepeat", xrepeat);
element.setAttribute("yRepeat", yrepeat);
This outputs something like xRepeat="3" yRepeat="8". Then I tried this…
element.setAttribute("xrepeat", xrepeat);
element.setAttribute("yrepeat", yrepeat);
The resulting output is yrepeat="8" xrepeat="3". Is there a reason why the attributes are being written in reversed order now? I already did the usual clean/qmake/build routine in my IDE (Qt Creator) to make sure that the compiler’s “only rebuild what was changed” feature wasn’t doing any weird stuff
The order of attribute specifications in a start-tag or empty-element tag is not significant. Don’t rely on software that requires a specfic order.