Eclipse中设置XML文件的自动格式化配置

来源:互联网 发布:项目经验怎么写 知乎 编辑:程序博客网 时间:2024/04/30 01:53
设置XML文件的自动格式化配置:  
   在Eclipse下编辑XML文件时可以像Java文件一样进行格式化。不过,默认的格式化设置效果不太理想,尤其是标签属性较多时。
通过以下设置可以达到一个相对理想的效果:
Window -> Preferences -> XML ->XML Files -> Editor :
1.1设置每行宽度Line width设定为80到100个字符。
1.2标签的每个属性都单独一行显示:选中Split multiple attributes each on a new line
1.3标签结束符不单独占用一行:不选中Align final bracket in multi-line element tags
1.4去掉所有空行:选中Clear all blank lines
1.5在标签结束符前添加空格:选中Insert whitespace before closing empty end-tags
1.6缩进使用空格代替tab:选中Indent using spaces
1.7设定缩进宽度Indentation size设定为4,即缩进4个空格。

0 0
原创粉丝点击