DermFrench
DermFrench

Reputation: 4057

Notepad++ XML Display on seperate lines like Internet Explorer Display Of XML

How do I get Notepad++ to display my XML on different lines like Internet Explorer (please note I can't change the XML).

Screenshot of XML displayed in Internet Explorer enter image description here Screenshot of XML displayed in Notepad++ enter image description here

Upvotes: 7

Views: 16861

Answers (2)

Mikkel Gunvald
Mikkel Gunvald

Reputation: 369

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

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

You may need to install XML Tools (Plugins | Plugin Manager), if it isn't already installed.

Credit: How to format XML in Notepad++?

Upvotes: 10

Richard
Richard

Reputation: 108995

Internet Explorer uses an XSLT (its an embedded resource in one the the IE dlls1) to transform the XML into HTML with styling and some JavaScript (allowing elements to be expanded/collapsed).

You'll need to do something similar. A no-op XSLT (input and output XML are the same except for non-significant whitespace) with <xsl:output … indent="yes" /> would at least get something readable.


1 I've forgotten which one, but reading it was instructive.

Upvotes: 0

Related Questions