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 ‘Failed to Acquire the VirtualBox COM Object’ Error

Several users are reporting that they are unable to launch VirtualBox. The critical error message that comes up is  “Failed to acquire the VirtualBox COM object. The application will terminate”.  In some cases, the error is also accompanied by a second error message pointing towards the problem. The issue does not seem to be specific to a certain Windows version since it’s confirmed to occur on both Windows 8.1 and Windows 10. Failed to acquire the VirtualBox COM object. The application will now terminate. What is causing the ‘Failed to Acquire the VirtualBox COM Object’ error? We investigated this issue by looking at various user reports and the repair strategies that are commonly deployed successfully in this particular scenario. As it turns out, there are multiple culprits that might end up triggering this issue: VirtualBox is not installed with admin access  – Virtualbox is one of those software products that will require you to install them with a...

How to Fix Windows 10 Pin Issues when Logging In

Windows 10 provide a very convenient way of logging in to your Windows using a pin code. However, some users are experiencing problems with the Windows 10 pin login. After a Windows Update, users can’t sign in using their previous pin code. And this isn’t related to users forgetting their pin codes. It seems like their old pin code has been removed from the Windows and their PCs aren’t recognising it. Now, there are a lot of scenarios of this. Some people can’t sign in because the system doesn’t recognise their PIN. On the other hand, some people can’t even enter their pin because there isn’t a pin option available for them. What Causes the Pin to Stop Working? Here is a list of things that can cause this issue A bug in the Windows Update that might have broken the PIN sign in option Corrupt files in the Ngc folder Usually it happens after a Windows Update so it’s a bug that breaks the PIN sign in option. Tips Before you dive deep in to the methods given below...