Eclipse:如何格式化工作空间中的所有xml文件?

时间:2021-12-24 21:04:21

I greatly appreciate the functionality of Eclipse to apply code formatter to all projects in workspace, however it works only for Java files, I'd like now to apply formatter to all XML files. And there are a pack of them: pom's, Spring configs etc.

我非常感谢Eclipse将代码格式化程序应用于工作空间中的所有项目的功能,但它仅适用于Java文件,我现在想将格式化程序应用于所有XML文件。还有一包它们:pom's,Spring configs等。

I've found no build-in format that could do the task for all selected projects. So, my question, do you know an external plugin that would do the task (possibly with own format settings that could be exported/imported)? Or I have missed an existing option?

我发现没有可以为所有选定项目执行任务的内置格式。所以,我的问题,你知道一个外部插件可以完成任务(可能有自己的格式设置,可以导出/导入)?或者我错过了现有选项?

1 个解决方案

#1


6  

Here's what I did: File Search for all files with file name pattern *.xml. In Search results, select all and then right click, Source -> Format. I'm on Eclipse Luna 4.4.2, not sure how far back this feature goes.

这就是我所做的:文件搜索文件名模式* .xml的所有文件。在“搜索结果”中,选择“全部”,然后右键单击“源” - >“格式”。我正在使用Eclipse Luna 4.4.2,不知道这个功能有多远。

#1


6  

Here's what I did: File Search for all files with file name pattern *.xml. In Search results, select all and then right click, Source -> Format. I'm on Eclipse Luna 4.4.2, not sure how far back this feature goes.

这就是我所做的:文件搜索文件名模式* .xml的所有文件。在“搜索结果”中,选择“全部”,然后右键单击“源” - >“格式”。我正在使用Eclipse Luna 4.4.2,不知道这个功能有多远。