有选择地关闭XML文件的Eclipse格式

时间:2011-07-21 15:40:17

标签: xml eclipse formatting

有一种方法可以有选择地关闭Eclipse格式(Java代码)(参见here)。

是否存在XML文件格式的等价物?

3 个答案:

答案 0 :(得分:5)

没有。您唯一能做的就是选择“使用PCDATA内容保留标签中的空格”

答案 1 :(得分:3)

<token><![CDATA[..... Your line ....]]></token>

在Eclispe上,我在pom.xml中使用此解决方案

<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
    <version>1.5.3</version>
    <executions>
        <execution>
            <phase>compile</phase>
            <goals>
                <goal>replace</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
    <basedir>${basedir}</basedir>
    <unescape>true</unescape>
    <includes>
        <include>src/test/resources/steps/scenarios/xxxxxx.feature</include>
    </includes>
    <token><![CDATA[Then home page is displayed[\\s\\S]*Then go to PRODUCTION]]></token>
    <value><![CDATA[Then home page is displayed\n\n    ##patch for IC\n    Then I change CP\n    ##end patch for IC\n\n    Then go to PRODUCTION]]></value>
    </configuration>
</plugin>

答案 2 :(得分:0)

我不知道如何设置它,但是如果您正在使用某种预定义的一致性,则可以使用XML文件的 Design 选项卡,使用 XML Editor 打开em>添加/编辑标签。