5

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

DermFrench
  • 3,968
  • 13
  • 43
  • 70

2 Answers2

7

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++?

Community
  • 1
  • 1
Mikkel Gunvald
  • 339
  • 1
  • 13
0

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.

Richard
  • 106,783
  • 21
  • 203
  • 265
  • can you actually do this within Notepad++? – DermFrench Nov 14 '13 at 13:31
  • No idea: my focus on explaining how IE does it and thus the core of an approach. XSLT authoring and integration when loading applicable target files on load is left as an exercise :-). – Richard Nov 14 '13 at 14:08