View Full Version : Attributes order in QDomElement

13th August 2009, 09:01
Hello all,

Can I do something with attributes' order in QDomElement? I'm adding new attribute by setAttribute() member and I have attributes in non predictable order(I see no reason in such order). Is it possible to control this order or I should accept unpredictable attribute order?


13th August 2009, 10:17
What do you mean by unpredictable? You mean that if you run the same application a few times you get a different order of attributes each time?

13th August 2009, 11:45
No, I have the same order always. But I can't predict this order before I run the application at least once. I need to know the order because I want to compare XML file created via QDomDocument with my etalon XML file, but if I have the different order I won't able to have a right comparison result.

21st August 2009, 13:52
A round about solution is to use XQuery to extract the XML Nodes. Here the attributes are retrieved in the same order as in the Physical file.