Eclipse:用于保存的自动格式XML文件。

时间:2022-04-23 11:12:49

Is it possible to somehow auto-format when saving XML files in Eclipse?

在Eclipse中保存XML文件时,是否可能以某种方式自动格式化?

I know it's possible to do it for Java files, but I would like it to happen for XML files as well.

我知道对Java文件可以这样做,但我希望对XML文件也这样做。

Specifically, I'm using and loving the auto format feature for XML files while developing for Android, as Android is quite heavy on using XML files.

具体地说,我在开发Android时使用并热爱XML文件的自动格式特性,因为Android在使用XML文件方面相当繁重。

3 个解决方案

#1


5  

I'm going to answer my own question using my own article about the fix that's about to be rolled out to ADT: http://www.androidpolice.com/2010/11/09/for-android-developers-next-version-of-eclipse-adt-to-include-auto-formatting-of-xml/

我将用我自己的文章来回答我自己的问题:http://www.androidpolice e.com/2010/11/09/for android-developer -next version- eclipse- adto -include-auto-formatting-of-xml/

Update: since r14, ADT can now finally do this. http://tools.android.com/recent/xmlformatter

更新:由于r14, ADT现在终于可以这样做了。http://tools.android.com/recent/xmlformatter

#2


5  

For eclipse auto-format try Ctrl+Shift+F

对于eclipse自动格式,请尝试Ctrl+Shift+F

#3


3  

It's been requested in WTP (bug 221696), but for now increasing the formatter's quality and speed in general has a higher priority.

它是在WTP (bug 221696)中被请求的,但是现在提高格式化程序的质量和速度是一个更高的优先级。

#1


5  

I'm going to answer my own question using my own article about the fix that's about to be rolled out to ADT: http://www.androidpolice.com/2010/11/09/for-android-developers-next-version-of-eclipse-adt-to-include-auto-formatting-of-xml/

我将用我自己的文章来回答我自己的问题:http://www.androidpolice e.com/2010/11/09/for android-developer -next version- eclipse- adto -include-auto-formatting-of-xml/

Update: since r14, ADT can now finally do this. http://tools.android.com/recent/xmlformatter

更新:由于r14, ADT现在终于可以这样做了。http://tools.android.com/recent/xmlformatter

#2


5  

For eclipse auto-format try Ctrl+Shift+F

对于eclipse自动格式,请尝试Ctrl+Shift+F

#3


3  

It's been requested in WTP (bug 221696), but for now increasing the formatter's quality and speed in general has a higher priority.

它是在WTP (bug 221696)中被请求的,但是现在提高格式化程序的质量和速度是一个更高的优先级。