Notepad++ is an Editor for source format with the following features.
- Indentation format
- Syntax Highlight
- Edit files of any type
- file validation
Notepad++, like any other editor, starts as a simple editor, but you can configure and install plugins to get additional features.
Notepad++ has an XML TOOLS
plugin that provides a lot of features validation, format auto comments
How to open XML Files in Notepad++?
The XML file contains tags and strings with rules, So these files can be opened in Notepad++ directly, modified, and saved the files.
It supports opening and reading larger XML files by reading XML content into memory, So Notepad++ throws an Out Of Memory Exception If the file is in size of GB.
How to format XML file in Notepad++
In Notepad++, the Following are step-by-step guide to pretty print xml in Notepad++
- Click on the
Plugins
Menu and selectPlugins Admin
- In the Search box, Type pretty XML and Check XML Tools Checkbox, and click on Install.
This installs XML plugins in Notepad
Open XML file in Notepad++
Click on the
Plugins
Menu, SelectXML Tools
->Pretty Print
orPretty Print - Indent attributes
orPretty Print - Indent only
option, or you can choose the shortcut keyCTRL+ALT+Shift+A
orCTRL+ALT+Shift+A
command.You can see the below image for more options
This formats the XML content with a pretty print
How do I enable syntax highlighting for XML files in Notepad++?
Syntax Highlight is an important feature of any Editor for enhancing user readability with text colors.
Notepad++ includes the ability to configure user-defined files with syntax highlighting.
Syntax highlight is already enabled by default in XML.
You can enable it by Selecting the Language
Menu -> X -> XML and It highlights color syntax for XML files for opening in the editor.
You can still configure and change the colors with the below steps.
Go to Settings
-> Style configurator
- Select XML
language.
With these steps, you can change styles for the below things.
- Foreground and background color
- Change font styles like font size, Bold, Italic, and Underline
- Styles for double and single quote text
- Boolean and number text styles
XML validation with Notepad++
Notepad++ has support for the validation of XML file content.
Validation can be done using Plugin Menu -> XML Tools ->Validate option or you can use shortcut CTRL+ALT+Shift+M. It asks for an XML schema to validate against and display errors.
If these things are not working, you can check online XML validators
for the desired thing.