维护Eclipse中自动格式化的XML注释部分的格式

时间:2012-07-12 13:12:15

标签: xml eclipse pretty-print

在Eclipse(Helios)中,我有这个XML源文件:

<?xml version="1.0" encoding="utf-8"?>
<!--
I wanted to 
===========
save this format of the comments.

-->
<x>
</x>

格式化文件(Ctrl + Shift + F)后,我重新格式化了评论。

<?xml version="1.0" encoding="utf-8"?>
<!-- I wanted to =========== save this format of the comments. -->
<x>
</x>

是否可以选择关闭漂亮的打印评论部分?

2 个答案:

答案 0 :(得分:10)

我正在使用Eclipse 3.6.0。

在Windows中&gt;偏好&gt; XML&gt; XML文件&gt;编辑:

取消选中加入行选项。

答案 1 :(得分:1)

您只能选择部分XML文件进行格式化,并忽略评论部分。