Closed slavidodo closed 6 years ago
This is done already in the dom element.
Maybe you got the order defined in the XML file just by change. Lua pairs function defines an arbitrary order to iterate over the table elements when they don't have a numbered index.
Ok, in pugixml you can easily do something like:
for (pugi::xml_node& node : root.children()) { ... }
This is useful if you want the nodes in order. My case is that i am using xml to handle some ui elements, so the order of the elements must be known in order to view them correctly.
Current behaviour
Expected behavior
This doesn't use more memory since tables in lua are actually passed by ref. So children table will just have a reference to the original tables sorted by element name.