HTML5 RNC- 数据类型库 "http://whattf.org/datatype-draft" 无法识别

HTML5 RNC- datatype library "http://whattf.org/datatype-draft" not recognized

我试图根据 github 中可用的 Nu RNC 集验证我的 HTML5 文档,com/validator/validator/tree/master/schema/html 使用 jing,我最终得到 "datatype library "http://whattf.org/datatype-draft not recognized”错误。我不确定错误到底是什么。是否无法使用 jing 中的此 RNC 集验证 HTML5?

https://github.com/validator/validator/tree/master/schema/html5 架构的维护者。

该模式并不真正意味着在 Nu Html Checker 的上下文之外使用。除其他外,它依赖于一个数据类型库——一组 Java 类——我们不单独 package/distribute。

您的类路径中缺少它会导致您引用的“数据类型库……无法识别” 错误。为了让它工作,在你的类路径中你需要有一个包含那些 类 的 jar 文件和一个特殊的清单。

我们确实分发了一个包含这些内容的 jar 文件,但也包含很多其他内容 — 这个 jar 文件有 22MB。 你可以从这里得到那个(压缩的)罐子:

https://github.com/validator/validator/releases/download/17.3.0/vnu.jar_17.3.0.zip

解压缩后,您将拥有一个本地 vnu.jar 文件,您可以像这样使用它:

java -cp vnu.jar com.thaiopensource.relaxng.util.Driver \
  -c https://raw.github.com/validator/validator/master/schema/html5/xhtml5.rnc \
  FILE.xhtml

当然,如果您有 https://github.com/validator/validator repo, then you can replace https://raw.github.com/validator/validator/master/schema/html5/xhtml5.rnc 的本地克隆,并且文件系统路径指向该 xhtml5.rnc 文件的本地副本。