是否有任何基于Maven的HTML验证程序 [英] Are there any Maven based HTML Validators

查看:105
本文介绍了是否有任何基于Maven的HTML验证程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含许多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. 文件在语法上是正确的(例如,检查所有开头标签是否具有与之对应的结束标签)
  2. 文件符合编码准则

任何人都可以推荐一个可以做到这一点的好的验证器吗?

Can anybody recomend a good validator that would do this?

推荐答案

我正在将 Sonar 与2个重要的插件为

I'm using Sonar with the 2 significant plugins as

  1. XML插件

此插件可以分析Sonar中的XML文件. 一些常见的用例是:

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

  1. 根据W3C提供的模式(严格,过渡和其他)验证XHTML文件
  2. 根据提供的XML模式验证XML文件
  3. 验证XML文件中的规则(例如:对照编码标准验证Maven pom文件)

2. Web插件

该插件可对Sonar中的Web文件进行静态代码分析.当前支持JSP和JSF.为Ruby模板(erb文件)提供了一些初始支持.

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).

支持以下指标:

  1. 调整大小(文件,代码行)
  2. 遵守规则
  3. 复杂性
  4. 重复
  5. 评论

默认情况下,插件会扫描以下文件:.xhtml,.jspf,.jsp.文件扩展名是可配置的.

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

该插件在Sonar中导入源代码,计算度量并扫描代码中的违规,重复和复杂性.这些检查可以在Sonar规则存储库中配置.

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.

所有这些都是开源.无论如何,Sonar还提供了名为 Web(HTML,JSP)的商业插件.也是

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

这篇关于是否有任何基于Maven的HTML验证程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆