【问题标题】:HTML 5 Reference/Specification?HTML 5 参考/规范?
【发布时间】:2012-08-17 02:56:14
【问题描述】:

对不起我的英语。

我有用于生成 HTML 表单的 PHP 类:

class Html_ElementInput extends Html_Element
{
    public function __construct($type=null)
    {
        parent::__construct();

        $this->attrs = array
        (
            'type' => array('text', 'password', 'checkbox', 'radio', 'submit', 'reset', 'file', 'hidden', 'image', 'button'),
            'name' => 'CDATA',
            'value' => 'CDATA',
            'checked' => array('checked'),
            'disabled' => array('disabled'),
            'readonly' => array('readonly'),
            'size' => 'Number',
            'maxlength' => 'Number',
// ......

这种格式是模拟 SGML-DTD 描述 xHTML - http://economist.rudn.ru/files/web-studio/docs/html/xhtml/xhtml_1.0/xhtml1-transitional_dtd.txt

我想改变他们基于 HTML5 的类,但是没有 SGML-HTML5 规范的描述。

我是否正确理解 SGML-HTML5 描述不会?

【问题讨论】:

标签: php html dtd specifications


【解决方案1】:

HTML 5 不是基于 SGML。它有两种序列化,XML 和 HTML 5。没有 SGML 版本的 HTML 5。

据我所知,该语言没有官方的机器可读描述。我预计一旦语言稳定下来就会有,但它仍在开发中。

作为validator.nu 一部分的非官方(可能并不总是最新的)RelaxNG schema is available

【讨论】:

  • 好的。但是为什么这个规范没有“机器可读的描述”呢?程序员必须为他们的应用程序提供有关这种语言的结构信息。好的。谢谢!
  • 因为它希望使用 HTML5 解析器而不是通用 SGML 解析器来处理文档。
猜你喜欢
  • 2013-04-26
  • 2010-10-01
  • 2016-05-14
  • 2013-01-22
  • 2018-10-09
  • 2021-10-05
  • 2011-02-23
  • 1970-01-01
  • 2023-03-28
相关资源
最近更新 更多