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 Install Notepad++ Hex Editor Plugin

Notepad++ is a free text editor and source code editor for use with Microsoft Windows. It supports several languages and tabbed editing, which allows working with multiple open files in a single window. The project’s name comes from the C increment operator. However, there are few text files which users are unable to open using Notepad++. But there are plugins for different kind of formats of text and programming languages which you install for your Notepad++. One of the many plugins is Hex Editor Plugin; used for viewing the text in Hex format. How to install Hex-Editor on Notepad++ What is the Hex Editor? The name ‘Hex’ comes from hexadecimal which is a numerical format for representing binary data. A Hex Editor is a program which lets you analyze, view and edit the hexadecimal coded files. Sometimes user comes across a file that can’t be opened for a reason but you can open the file in Hex Editor and most of the files will have ...

Fix: System Found Unauthorized Changes on the Firmware, Operating System or UEFI Drivers

Several users are struggling with the  System found unauthorized changes on the firmware error  at every startup or when trying to take their computer out of hibernation mode. Most affected users report that the issue started occurring after they installed some pending Windows updates. The issue is mostly encountered on Windows 7. The system found unauthorized changes on the firmware, operating system or UEFI drivers. Press [OK] to run the next boot device, or enter directly to BIOS Setup if there are no other boot devices installed. What is causing the System found unauthorized changes on the firmware error We investigated this particular issue by looking at various user reports. This error will occur whenever your system is checking the firmware one some computer hardware parts as part of a new security feature. To be precise, the error is occurring because not all Windows versions will support this new security feature. As it turns out, there are sev...