Grunt plugin to validate XML files and test if the documents are well-formed using a XSD schema
npm install grunt-xml-and-xsd-validator~0.4.4
shell
npm install grunt-xml-and-xsd-validator --save-dev
`
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-xml-and-xsd-validator');
`
The "xml_validator" task
$3
In your project's Gruntfile, add a section named xml_validator to the data object passed into grunt.initConfig().
`js
grunt.initConfig({
xml_validator: {
your_target: {
src: [ 'your_files/*.xml', 'another_file.xml' ],
options: {
xsd: 'your_files/my_schema.xsd'
}
},
},
});
``