Force ordering in LightXML?


Using LightXML my understanding has been that it is in alphabetical order, but for some reason not in this case:


And the code is entered as:


Would anyone happen to know why / if this can be fixed / forcing ordering?

Kind regards

Just as I wrote I found the solution.

Use OrderedDict from

Takes more allocations, but if ordering is important it works very well.

Kind regards


Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.

Thanks! I was aware of this, in my case the file is to be used both by human and machine. Therefore it is nice to have it say “x y z” instead of “x z y” etc.

Kind regards