Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Free XML Formatting tool [closed]

People also ask

How do I autoformat XML?

Right click Config folder -> Properties -> Security tab -> select Users, click Edit -> check Full control to allow read/write access. Note that you need administrator privileges to do that. Restart npp and verify TextFX -> TextFX HTML Tidy -> Tidy: Reindent XML works.

Why XML file is not opening?

Many XML programs will set themselves as the default program for XML files, allowing you to simply double-click the XML file to open it. If you can't, right-click the XML file and select "Open With." Browse for your newly-installed program.

How do I make an XML file readable?

If all you need to do is view the data in an XML file, you're in luck. Just about every browser can open an XML file. In Chrome, just open a new tab and drag the XML file over. Alternatively, right click on the XML file and hover over "Open with" then click "Chrome".

Can Notepad ++ edit XML?

The XML file contains tags and strings with rules, So these files can be opened in notepad++ directly, modify and save the files.


I believe that Notepad++ has this feature.

Edit (for newer versions)
Install the "XML Tools" plugin (Menu Plugins, Plugin Manager)
Then run: Menu Plugins, Xml Tools, Pretty Print (XML only - with line breaks)

Original answer (for older versions of Notepad++)

Notepad++ menu: TextFX -> HTML Tidy -> Tidy: Reindent XML

This feature however wraps XMLs and that makes it look 'unclean'. To have no wrap,

  • open C:\Program Files\Notepad++\plugins\Config\tidy\TIDYCFG.INI,
  • find the entry [Tidy: Reindent XML] and add wrap:0 so that it looks like this:
[Tidy: Reindent XML] 
input-xml: yes 
indent:yes 
wrap:0 

Firstobject's free XML editor for Windows is called foxe is a great tool.

Open or paste your XML into it and press F8 to indent (you may need to set the number of indent spaces as it may default to 0).

It looks simple, however it contains a custom written XML parser written in C++ that allows it to work efficiently with very large XML files easily (unlike some expensive "espionage" related tools I've used).

From the product page:

The full Visual C++ source code for this firstobject XML editor (including the CDataEdit gigabyte edit control MFC component) is available as part of the Advanced CMarkup Developer License. It allows developers to implement custom XML handling functions such as validation, transformation, beautify, and reporting for their own purposes.


Use the following:

xmllint --format


You can open the XML file in any Visual Studio Express product and the press Ctrl+A, Ctrl+K, Ctrl+F to get it nicely formatted.

Hey, it's free and it's a tool, so it fits the question. :-)


Another method to reindent XML in Notepad++:

From menu select Plugins -> XML Tools -> Pretty print (XML only – with line breaks)
or press Ctrl+Alt+Shift+B.