Reputation: 9226
I'd like
<node a="2" d="1" c="2">
to be converted to
<node a="2" c="2" d="1">
Can you propose some solution with less effort?
Upvotes: 0
Views: 2092
Reputation: 163645
Use an XML canonicalization library. XML canonical form requires the attributes to be in alphabetical order (so that two documents can be compared for equivalence by comparing them at the byte level).
Upvotes: 3