首页 > 其他 > 详细

Using Notepad++ To Quickly Format XML

时间:2014-03-06 11:56:29      阅读:615      评论:0      收藏:0      [点我收藏+]

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:

bubuko.com,布布扣

 

2) Click Next:

bubuko.com,布布扣

3) Agree to the License Agreement:

bubuko.com,布布扣

4) Choose where you want to install the files:

bubuko.com,布布扣

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

bubuko.com,布布扣

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:

bubuko.com,布布扣

7) Click Install:

bubuko.com,布布扣

8) Click Finish and you’re done!

bubuko.com,布布扣

 

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:

bubuko.com,布布扣

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

bubuko.com,布布扣

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

bubuko.com,布布扣

 

Installing the XML Tools

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

bubuko.com,布布扣

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):

bubuko.com,布布扣

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

bubuko.com,布布扣

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

bubuko.com,布布扣

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++):

bubuko.com,布布扣

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

bubuko.com,布布扣

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:

bubuko.com,布布扣

After doing Ctrl+Alt+Shift+B:

bubuko.com,布布扣

Sweet!

Using Notepad++ To Quickly Format XML,布布扣,bubuko.com

Using Notepad++ To Quickly Format XML

原文:http://www.cnblogs.com/androidme/p/3582668.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!