Skip to main content

How to Format/Indent XML Files in Notepad++

Notepad++ is a free text and source code editor that is mostly used by programmers. It is an advanced alternate version of the default notepad which supports 50 programming, scripting and markup languages. It allows a user to edit codes within multiple tabs in a single window. However, it lacks the formatting for XML files or XML code. Users will find it difficult to edit or read the XML code without the correct format for code.
How to Format/Indent XML Files on Notepad++

What is XML File?

XML (stands for eXtensible Markup Language) which is a language designed to store and transport data. XML files are just plain text files that can’t do anything on their own. Custom tags are used in XML files to define objects and the data within each object. It defines a set of rules for encoding documents in such a format that both humans and machines could read. XML is similar to HTML but the difference is that HTML defines how data looks, while XML defines what data is.

XML Code sample

Step 1: Adding Plugin Manager from Github

Plugin Manager is a Notepad++ plugin through which you can install, update and remove available plugins. Plugin Manager was removed from the official distributors after the Notepad++ version 7.5. The reason for removing this plugin was sponsored advertising at the bottom of the plugin window. Recently Notepad++ added the “Plugins Admin” as a replacement for the Plugin Manager with same features and no Ads, but it is still in the test version and the list of available plugins are still missing many of the plugins.
Skip this step if you already have a Plugin Manager in your Notepad++. Plugin Manager is removed but you can still add/install it manually by following the steps below:
  1. First go to this GitHub link: Plugin Manager
  2. Choose 32bit or 64bit zip file to download depending on your Notepad++
    Download zip files for Plugin Manager on GitHub
    1. (If you don’t have WinRAR, just open the zipped folder and drag the files/folders from the zipped folder to a new location)
    2. Extracting the zip file
    3. You will find two folders named “plugins” and “updater” in the extracted folder. Keep it open and locate the Notepad++ folder in another window:
      C:\Program Files\Notepad++
    4. You will find same named folders in Notepad++ directory, copy the files from extracted folders and pastethem in the exact folders of Notepad++
      Copy from downloaded folder to Notepad++ folder
    5. Once you are done, restart you Notepad++ and Plugin Manager will be available in the Plugins menu.
    6. Step 2: Installing XML Tools Plugin through Plugin Manager

      In this method, we will be installing the XML Tools plugin through Plugin Manager. By default, there is no option available to format/indent the XML code but you can modify it by using this plugin. With this tool you can convert text to XML and XML to text, enable auto check XML syntax and more.
      1. Open Notepad++ by double-clicking on the shortcut
      2. Click on Plugins in the menu bar, choose Plugin Manager and then Show Plugin Manager
      3. A window will open with a list of all available plugins, then search for “XML Tools
      4. Select the plugin and click on the Install button, then it will ask for restart Notepad++ after installing.
        Installing XML Tools through Plugin Manager
      5. Now you can open the XML file or copy the code in the new tab
        Opening random XML File
      6. Click on Plugins and then choose XML Tools > Pretty Print (XML only –with line breaks)
        Tip: 
        libXML option gives the nice output but only if the file is 100% correctly formed.
        Changing the format of XML Code by using XML Tools
      7. This will change the format of the code.

Comments

Popular posts from this blog

How to Fix ‘The Local Security Authority Cannot be Contacted’ Error on Windows

This error appears when users try to login to other computers via a remote desktop connection. The problem prevents them from connecting and it displays the “The Local Security Authority Cannot be Contacted” error message. The problem often appears after an update has been installed on either the client or the host PC and it causes plenty of problems on many different versions of Windows. The Local Security Authority Cannot be Contacted There have been many unofficial fixes for the problem which were created by the users who had the same unfortunate experience. We have gathered the working methods in this article so make sure you follow it in order to resolve the problem. What Causes “The Local Security Authority Cannot be Contacted” Error on Windows? Pinpointing the correct cause for the problem is one of the most important steps when it comes to resolving one. That is why we have created a list of possible causes for the problem so make sure you check it out below: D...

Fix: The Active Directory Domain Services is currently unavailable ‘Windows 7, 8 and 10’

The error Active Directory Domain Services is currently unavailable means that the system is not able to find and connect to your printer, hence the process is stopped and cannot proceed further. This process allows the computer to manage and allocate resources. If this error occurs, it means that there is most probably a problem with the permissions, drivers, UAC etc. We have listed down a number of solutions for you to check. Start with the first one and work your way down. Solution 1: Resetting Printer Spooler Settings The spooler service is a software program which is responsible for managing all print jobs being sent to the computer printer. The print spooler service is usually visible to users and they can also cancel a print job which is being processed. It also allows them to manage jobs which are currently on the waitlist. We can try restarting this service and check if this solves the problem. Press  Windows + R  to launch the Run application. Type ...