eclipse xml 'Indent using spaces' not work /eclipse xml 使用空格缩进功能未生效问题解决

eclipse xml 'Indent using spaces' not work

eclipse xml 使用空格缩进功能未生效问题解决

设置xml格式化配置

image

  • Line width: 设置每行宽度Line width设定为80到100个字符。
  • Split multiple attributes each on a new line: 标签的每个属性都单独一行显示
  • Preserve whitespace in tags with PCDATA content: 保留具有 PCDATA 内容的标签中的空白
  • Align final bracket in multi-line element tags: 标签结束符不单独占用一行
  • Clear all blank lines: 去掉所有空行
  • Insert whitespace before closing empty end-tags: 在标签结束符前添加空格
  • Indent using spaces: 缩进使用空格代替tab
  • Indentation size: 如果use tabs,设定为1,代表使用1个tab; 如果使用use spaces,设定缩进宽度设定为4,即缩进4个空格

设置文本格式配置

测试过程中发现,按照以上配置设置好xml格式化配置后,对xml文件格式化仍然使用tabs,还需要进行以下配置才会生效。

image

总结

以上,对xml格式化时便符合预期了。

posted @ 2025-03-07 14:22  leeyazhou  阅读(60)  评论(0)    收藏  举报