【问题标题】:Processing W3C css validator output with Violations处理带有违规的 W3C css 验证器输出
【发布时间】:2013-01-18 15:49:16
【问题描述】:

linter 和验证器的输出格式比解析它们的工具要多得多。我找不到任何工具可以解析 W3C 自己提供的规范 CSS 和 HTML 验证器的输出。 W3C CSS 验证器提供的输出格式记录在User Guide 中(包括一种仅使用--format=xml 启用的未记录输出格式)。是否有任何工具(例如 Jenkins 插件)可以将 W3C CSS Validator 输出的任何格式处理为图形或其他人类可消费的报告格式?

【问题讨论】:

    标签: validation continuous-integration reporting w3c


    【解决方案1】:

    我不知道。但我确实写了an XSLT,它将java -jar css-validator --format=soap12 的输出转换为与csslint 相同的格式,Violations 可以处理。

    验证器本身总是在 XML 上方输出其选项,因此您必须先将其删除,然后才能对其进行转换:

    java -jar css-validator --format=soap12 "$someFile.css" |
        tail -n +1 | # GNU tail, or use some other way of trimming the first line
        xsltproc css-validator-to-csslint.xsl -
    

    我希望有人觉得这很有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多