Kit
Kit

Reputation: 31503

Sort XML attributes in Eclipse

I'm using Eclipse 3.6.2 and the Android Development Tools plug-in. In layouting apps, I use both the Graphical Layout and XML source editors.

After using the graphical editor, I can format the XML source with the XML preferences and Command+Shift+F. How do I sort XML attributes alphabetically?

Upvotes: 2

Views: 2026

Answers (2)

riha
riha

Reputation: 2298

Looks like Eclipse ADT 13 will be able to sort your Android XML attributes. http://code.google.com/p/android/issues/detail?id=16890

Upvotes: 0

Michael Kay
Michael Kay

Reputation: 163262

In XML the order of attributes is not significant, so most XML tools assume that they can output attributes in an arbitrary order and the user will not care. Indeed, any downstream processing that depends on the order of attributes is faulty.

I can see that controlling the display order of attributes can be useful for the human reader even if it actually carries no information, but I don't know of any tools that allow you to control this.

Upvotes: 1

Related Questions