Using Notepad++ To Quickly Format XML

本文介绍如何利用Notepad++及其XMLTools插件快速地格式化XML代码。通过详细步骤指导安装Notepad++及配置相关设置,并演示了如何使用Prettyprint(XML only–with line breaks)功能美化XML文档。
摘要由CSDN通过智能技术生成

http://geek.sylvainw.com/2010/03/28/using-notepad-to-quickly-format-xml/

My favorite way to quickly format a given chunk of XML is to use Notepad++ and the XML Tools plugin.  You can get Notepad++ here.  And the XML Tools plugin is here(you’ll have to wait a few seconds before the download starts).

Installing Notepad

(the following instructions are based on Notepad++ v5.9.4 and my differ in later versions)

1) Choose your language:

image

 

2) Click Next:

image

3) Agree to the License Agreement:

image

4) Choose where you want to install the files:

image

5) Choose what options you want to install (I simply use the defaults):

image

6) Choose the final set of options.  I check the first one because I like having applications keep their data in their own installation directory:

image

7) Click Install:

image

8) Click Finish and you’re done!

image

 

Settings In Notepad++

There are a few settings that I always set that (I find) make life more convenient (but that’s just me).

Under Settings | Preferences:

image

On the “General” tab, I check “Show close button on each tab”.

image

On the “MISC.” tab, I uncheck “Remember current session for next launch” because I always want Notepad++ to open with a new blank document.

image

 

Installing the XML Tools

If you run Notepad++ and look in the Plugins menu, you’ll see that the XML Tools aren’t there:

image

1) Download the XML tools from here.

2) Unzip the file and copy the XMLTools.dll to the Notepad++ plugins folder (in the example above: C:\Program Files (x86)\Notepad++\plugins):

image

3) Re-start Notepad++ and you should now see the XMLTools appear in the Plugins menu:

image

When you click on “How to use…” you’ll get the following:

image

4) I’ve just tried (2011/10/20) following those links and the first one doesn’t work and the 2nd one just takes you to a directory listing. So, I’ve uploaded the zip file to my site and you can download the missing lib files from here.

5) Unzip the ext_libs.zip file and then copy the unzipped DLLs to the Notepad++ installation directory (in the example above: C:\Program Files (x86)\Notepad++):

image

6) Re-start Notepad++ and you should finally see the proper XML Tools menu:

image

The feature I use the most is “Pretty print (XML only – with line breaks)”.  This will format any piece of XML with all the proper line spacing.

Start with:

image

After doing Ctrl+Alt+Shift+B:

image

Sweet!

转载于:https://www.cnblogs.com/androidme/p/3582668.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值