kodybrown / sortxml

a very simple utility that prettifies and sorts xml files.
MIT License
44 stars 13 forks source link

Natural Order Sorting #3

Open bloodyshade opened 7 years ago

bloodyshade commented 7 years ago

Hi,

I really like this software, so far it has been the only reliable one I found to sort xml files. One thing I would love to see implemented is natural order sorting (mostly for attributes). I have a few 15mb xml files that I need to go through and diffing them is a problem unless using a tool like this one. But the output will order numbers like: 1, 10, 100, 2, 20... etc, instead of 1, 2, 10, 20, 100 as I think would be more appropriate.

If that could be implemented or a snippet of code given so I can change it on the .cs file directly I'd really appreciate it.

Anyway, thanks again.

dantheother commented 6 years ago

If you don't mind running on Windows 7 and above, I've got a fork that has this ability - https://github.com/dantheother/sortxml

This was the easiest for me. If you need a bit more cross platform juice, https://stackoverflow.com/a/7048016/11569 looks like a reasonable implementation (I've not tested it myself).

@kodybrown interested in a Pull Request for the natural/logical sort? Not sure what your view is on cross platform compatibility