如何在Notepad ++中格式化XML? [英] How do I format XML in Notepad++?

查看:209
本文介绍了如何在Notepad ++中格式化XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Notepad ++ ,我得到了一些很长的XML代码。当我将其粘贴到Notepad ++中时,有一长行代码(难以阅读和使用)。

I have Notepad++ and I got some XML code which is very long. When I pasted it in Notepad++ there was a long line of code (difficult to read and work with).

我想知道是否有一种简单的方法可以使文本可读(可读性,我指的是正确制表的代码)。

I want to know if there is a simple way to make the text readable (by readable I mean properly tabbed code).

我可以手动执行此操作,但是由于我已经多次遇到这种情况,我希望对此有一个永久的解决方案。我肯定有办法做到这一点,因为几年前我已经做过一次,也许使用我不记得是Visual Studio 还是其他编辑器。

I can do it manually, but I want a permanent solution to this as I have faced this several times. I am sure there is a way to do this as I have done it once before a couple of years back, maybe with Visual Studio or some other editor, I don't remember.

但是Notepad ++可以吗?

But can Notepad++ do it?

推荐答案

尝试插件-> XML工具->漂亮打印(libXML)或(仅XML-带有换行符 Ctrl + Alt + Shift + B

Try Plugins -> XML Tools -> Pretty Print (libXML) or (XML only - with line breaks Ctrl + Alt + Shift + B)

您可能需要使用插件管理器来安装XML工具才能获取

You may need to install XML Tools using your plugin manager in order to get this option in your menu.

根据我的经验,libXML会提供不错的输出,但前提是文件格式正确100%。

In my experience, libXML gives nice output but only if the file is 100% correctly formed.

这篇关于如何在Notepad ++中格式化XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆