Force ordering in LightXML?

Hello!

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

image

And the code is entered as:

:gravity=>Dict("x"=>0,"y"=>0,"z"=>-9.8065)

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 OrderedDicts and OrderedSets · DataStructures.jl

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

Kind regards

BTW,

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

https://www.w3.org/TR/REC-xml/#sec-starttags

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