Can someone explain how to use Notepad++ to validate an xml file against an xsd. There are no options in the "XML Tools" plugin dropdown that provides for specifying an XSD file. The XML plugin is installed properly in the plugins subdir and the 3 DLLs are copied to the Notepad++ EXE subdirectory. Other XML "validation" features work but there is no way to validate against an XSD.
-
i've seen several references (and screenshots) of specifying an XSD to validate an XML file - using Notepad++. for example http://www.michigan.gov/documents/cepi/STARR-UIC_XML_validation_guide_377050_7.pdf – user2174533 Mar 15 '13 at 15:37
-
The dialog seems no longer to exist. In XML Tools Plugin 2.4.9.2 it will not be displayed. – user9858098 May 28 '18 at 09:59
-
1Have u looked at http://when-others-then-null.blogspot.co.uk/2012/12/Validate-XML-against-an-XSD-using-npp.html It seems it contains what you need. – Shmil The Cat Mar 15 '13 at 15:41
-
Using the exact XML & XSD from this example worked and i realized what i was doing wrong. I didn't realize that the {xsi:schemaLocation="http://www.foobar.com/invoice invoice.xsd"} was actually reading the XSD from my hard drive from the same subdir as the XML file and validating. Thanks..... – user2174533 Mar 15 '13 at 16:34
-
@Shmil The Cat: How to against a dtd. – Farhan Shirgill Ansari Mar 18 '15 at 13:57
-
@ShirgillAnsari - For DTD validation the XML must contain the DOCTYPE specifying the DTD in the same directory as the XML. like: ` ` then the tool can figure it out. – Jesse Chisholm Aug 07 '15 at 22:16
-
Just an FYI, if you use nested schemas and refer other schema using relative path such as foo\abc.xsd, make sure that you use forward slash(/) instead of backward slash (\\) when validating in NPP Xml Tools plugin. If you use backward slash, it gives schema parsing error but forward slash works fine. – Harsh Oct 05 '16 at 00:16
1 Answers
In Notepad++ go to
Plugins > Plugin manager > Show Plugin Managerthen findXml Toolsplugin. Tick the box and clickInstallOpen XML document you want to validate and click Ctrl+Shift+Alt+M (Or use Menu if this is your preference
Plugins > XML Tools > Validate Now).
Following dialog will open:Click on
.... Point to XSD file and I am pretty sure you'll be able to handle things from here.
Hope this saves you some time.
EDIT:
Plugin manager was not included in some versions of Notepad++ because many users didn't like commercials that it used to show. If you want to keep an older version, however still want plugin manager, you can get it on github, and install it by extracting the archive and copying contents to plugins and updates folder.
In version 7.7.1 plugin manager is back under a different guise... Plugin Admin so now you can simply update notepad++ and have it back.
- 1
- 1
- 54,146
- 29
- 227
- 241
-
2`Plugin manager` is added back now in the latest releases of Notepad++, it is now called as `Plugins Admin...` – Saikat Jul 30 '19 at 08:18
-
1
-
This is magnificent and a decent solution. This should be added as a solution. – Alper Jan 21 '21 at 12:01
-
Thank you. Is there a way to check validation errors one by one? Right now I have to fix one, save it and re-run the XSD again :( – Ziya Apr 29 '21 at 19:43
-
If you are trying to validate web.confg. Needs .xml extension. Didn't work for me with web.config. So I renamed it to web.config.xml. – JohnWrensby Jun 15 '21 at 19:03