How to configure Eclipse XML formatting?

Posted by tputkonen on Stack Overflow See other posts from Stack Overflow or by tputkonen
Published on 2010-05-31T11:59:31Z Indexed on 2010/05/31 12:03 UTC
Read the original article Hit count: 276

Filed under:
|

I would like to change the way Eclipse formats XML files. For example, if I have in pom.xml file a section as follows:

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>

After ctrl+shift+f it will look like:

    <dependency>
        <groupId>
            junit
        </groupId>
        <artifactId>
            junit
        </artifactId>
        <version>
            3.8.1
        </version>
        <scope>
            test
        </scope>
    </dependency>

I prefer the first version, so how to configure Eclipse to format XML files to look like that?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about eclipse