Format xml in Notepad++

8

1

I have Notepad++ and XML Tools plugin installed. When I copy an XML file and paste it to the window. It became one line. How can I auo format it and make it readable?

Thanks.

The demo image likes: image

Love

Posted 2012-07-27T20:07:28.737

Reputation: 257

Answers

6

Plugins -> XML Tools -> Pretty Print (XML only - with line breaks)

Bob M

Posted 2012-07-27T20:07:28.737

Reputation: 334

1It seems that version 6.5 doesn't have this plugin :( – St.Shadow – 2013-11-29T10:31:01.403

3

How about Plugins - XML Tools - Pretty Print (XML only - with line breaks)? Default shortcut Ctrl+Alt+Shift+B. This should make your XML very readable.

JC2k8

Posted 2012-07-27T20:07:28.737

Reputation: 2 813

0

You will need TextFX plugin.

Then go for:

TextFX -> TextFX HTML Tidy -> Tidy: reindent XML

coelhudo

Posted 2012-07-27T20:07:28.737

Reputation: 173

Newer versions of NPP require external installation of tidy. I've basically stopped using it and adopted XML Tools – mlhDev – 2016-09-16T14:35:12.993

It is grayed out. It is not working but thanks. – Love – 2012-07-27T21:09:04.673

What NPP version do you have? I had a problem with libtidy.dll. – coelhudo – 2012-07-27T21:25:36.753

0

If you don't find the plugin you want to use (eg.: XML Tools), just add it by clicking:

Plugins -> Plugin Manager -> Show Plugin Manager

Find, select and install it. When you re-open Notepad++, it'll be listed under the Plugins menu. After that, do what they've already said: Plugins -> XML Tools -> Pretty Print (XML only - with line breaks)

Rodrigo Nobrega

Posted 2012-07-27T20:07:28.737

Reputation: 1

-1

Better option is:

Plugins -> XML Tools -> Linarize XML

user270146

Posted 2012-07-27T20:07:28.737

Reputation: 1

2Does not this function format the XML back to a single line (i.e. contrary to what was asked for)? – pabouk – 2013-11-07T08:36:42.243