Eclipse XML formatter inserts unneeded line breaks

坚强是说给别人听的谎言 提交于 2019-12-13 13:41:00

问题


Eclipse Version: Indigo Service Release 2

I can't get my XML formatter to do the job right.

When I apply formatter to this

<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>

i get this

<execution>

    <id>
compile
    </id>

    <phase>
compile
    </phase>

    <goals>

        <goal>
compile
        </goal>
    </goals>

</execution>

I want it to format like this:

<execution>
    <id>compile</id>
    <phase>compile</phase>
    <goals>
        <goal>compile</goal>
    </goals>
</execution>

I tried different options in XML -> XML Files -> Editor but none seems to work.
Thank you.


回答1:


The problem was in Android Editor, that was the default XML editor for me.

Two options to resolve this issue:

  • Use Eclipse XML editor Open With -> XML Editor
  • Disable "Standard Android XML style" in Android -> Editors


来源:https://stackoverflow.com/questions/12106037/eclipse-xml-formatter-inserts-unneeded-line-breaks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!