Reputation: 4057
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
Screenshot of XML displayed in Notepad++
Upvotes: 7
Views: 16861
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
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