是否有HTML5规格的机器可读版本? [英] Is there a machine-readable version of HTML5 specs?

查看:114
本文介绍了是否有HTML5规格的机器可读版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找HTML5规范的机器可读版本,类似于DTD,尽管任何格式都可以执行,只要它是可解析的。



HTML5规范似乎不包含任何类型,所以我的第一个想法是查看验证器。我挖掘了 validator.nu验证器的来源,但似乎他们使用的架构是通过解析规范来构建的(例如解析它的HTML及其英文文本)我将不得不构建验证器来生成它。



更具体地说,我正在寻找一个元素列表,他们的内容模型,以及他们的类型属性列表,以及他们是否需要或他们有默认值。



最后,我应该提到我是不寻找验证具体文件。我会直接使用W3C的验证器或validator.nu。我正在寻找这些规范,以便我可以在我自己的应用程序中使用它们。

看到两件有趣的事情:




  • 由于HTML5不再正式基于SGML的
    ,因此DOCTYPE不再是
    服务于此目的,因此不再需要
    来引用DTD。从
    起HTML5工作草案。它并没有说没有一个,只是客户不需要一个

  • 那个
    HTML5显然仍然是一个工作草案,而不是
    规范,这意味着
    可以成为稍后发布的DTD



我看起来像很难,因为你可能没有具体的东西。我认为validator.nu的方法是最好的,因为工作草案可能会在规范达成一致之前多次改变。如果有人发布了非官方的DTD,它需要不断的维护。

+1个很好的问题,我希望我能找到一个具体的答案。我希望别人可以!


I'm looking for a machine-readable version of the HTML5 specs, akin to a DTD, although any format would do as long as it's parsable.

The HTML5 specs don't seem to contain anything of the sort so my first idea was to look into validators. I dug into the sources of the validator.nu validator but it seems that the schema they use is build by parsing the specs (e.g. parsing its HTML and its english text) and I'll have to build the validator to generate it.

More specifically, I'm looking for a list of elements, their content models, and a list of their attributes with their type and whether they are required or they have a default value.

Finally, I should mention that I'm not looking for validating specific documents. I would use W3C's validator, or validator.nu directly. I'm looking for the specs so that I can use them in my own applications.

解决方案

Trawling through W3's site I can only see two things of interest on this:

  • "As HTML5 is no longer formally based upon SGML, the DOCTYPE no longer serves this purpose, and thus no longer needs to refer to a DTD." from the HTML5 working draft. It doesn't say there isn't one, just that clients don't need one
  • And that HTML5 is still a working draft obviously, not a specification, which implies there may be a DTD published later

I've looked as hard as you probably have with nothing concrete. I think validator.nu's approach is the best as the working draft is likely to change several times before a specification is ever agreed upon. If someone did publish an unofficial DTD it would need constant maintenance.

+1 great question, I wish I could find a concrete answer. I hope someone else can!

这篇关于是否有HTML5规格的机器可读版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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