Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any Maven based HTML Validators

Tags:

html

maven

I've got a project that contains a number of HTML files. As part of my Maven build process I'd like to run a validator across these files to make sure that:

  1. The files are syntactically correct (for example checking that all opening tags have a coresponding closing tag)
  2. The files conform to the coding guidelines

Can anybody recomend a good validator that would do this?

like image 699
Stormcloud Avatar asked Feb 28 '13 15:02

Stormcloud


1 Answers

I'm using Sonar with the 2 significant plugins as

  1. XML Plugin

This plugin enables analysis of XML files within Sonar. Some common use cases are:

  1. Validation of XHTML files against schemas provided by the W3C (strict, transitional, and others)
  2. Validation of XML files against a provided XML schema
  3. Validation of rules in XML files (ex: validate the Maven pom files against coding standards)

2 .Web Plugin

The plugin provides static code analysis of web files within Sonar. Currently JSP and JSF are supported. Some initial support is provided for Ruby templating (erb files).

The following metrics are supported:

  1. sizing (files, lines of code)
  2. rules compliancy
  3. complexity
  4. duplication
  5. comments

The plugin scans the following files by default: .xhtml, .jspf, .jsp. The file extensions are configurable.

The plugin imports the source code in Sonar, calculates measurements and scans the code for violations, duplications and complexity. The checks are configurable in the Sonar rules repository.

All of them are open source. Anyhow the Sonar also provides the commercial plugin named Web(HTML, JSP) as well.

like image 171
Charlee Chitsuk Avatar answered Oct 24 '22 02:10

Charlee Chitsuk