Order of XML attributes are reversed each time file is opened
Steps to reproduce:
- Create a new file; add an object or two (doesn't matter what, I just drew a spline)
- Save it and close Inkscape
- Make a copy of the file, or add it to source control
- Open it in Inkscape again
- Add an object and delete it (so that the document is "edited" but has no net change)
- Save it
- Compare the recently-saved file with the previous one
What happened?
The second file has many differences, which are all due to the order of the XML attributes being reversed.
What should have happened?
The files should be similar or identical.
Additional comments
Some experimentation shows that saving the document multiple times in one session doesn't change the attribute order, but opening it anew and saving it does, so I'm assuming the reversal happens when the XML is parsed.
In general I don't care what the attribute order is, as long as it's stable. It could be preserved, or Inkscape could always write them out in its preferred order. But having 90% of the file change on even a small edit makes careful editing more difficult.
Inkscape Version and Operating System:
- Inkscape Version: Inkscape 1.0beta2 (2b71d25d, 2019-12-03)
- Operating System: Linux x86_64
- Operating System version: Ubuntu 19.10
I'm using the Flatpak distribution in case that's relevant:
- Commit: c1200500141dfeb4ab4ae3703994f175bf5bbc00663494b07ae9a42de4611bfa
- Parent: 362e8cf533dff26172a611ab31d5297f2a4c1b3170880f71caec2f0a520fb7eb
- Subject: Update runtime to 3.36 (01410c16)
- Date: 2020-03-16 19:03:53 +0000
Sample files:
attrorder-firstsave.svg attrorder-secondsave.svg attrorder-thirdsave.svg