gpt4 book ai didi

html - 这个 HTML 代码 (`<!ENTITY % html.content …>` , `<!ELEMENT …>` , `<!ATTLIST …>` ) 写在 w3.org 是什么意思?

转载 作者:太空宇宙 更新时间:2023-11-04 15:42:58 29 4
gpt4 key购买 nike

我在 the HTML 4.01 specification at w3.org 中阅读了有关 HTML 文档结构的内容.然后我偶然发现了这段代码;它看起来像某种定义。你们中的任何人都可以详细说明它的用途和含义吗?

<!ENTITY % html.content "HEAD, BODY">

<!ELEMENT HTML O O (%html.content;) -- document root element -->
<!ATTLIST HTML
%i18n; -- lang, dir --
>

最佳答案

它是 HTML 4.01 DTD之一的片段:文档类型定义

参见 the tag wiki对于 其中包含更多链接。

DTDs define formal grammars for XML documents: which tags you can use and where you can use them.

HTML 4.01 specification你正在阅读的有一个introduction概述了规范的结构。

1.1 How the specification is organized

Sections 2 and 3: Introduction to HTML 4

[…]

The brief SGML tutorial gives readers some understanding of HTML’s relationship to SGML and gives summary information on how to read the HTML Document Type Definition (DTD).

第三部分提供了深入的解释:

3.3 How to read the HTML DTD

Each element and attribute declaration in this specification is accompanied by its document type definition fragment. We have chosen to include the DTD fragments in the specification rather than seek a more approachable, but longer and less precise means of describing an element’s properties. The following tutorial should allow readers unfamiliar with SGML to read the DTD and understand the technical details of the HTML specification.

关于html - 这个 HTML 代码 (`&lt;!ENTITY % html.content …>` , `&lt;!ELEMENT …>` , `&lt;!ATTLIST …>` ) 写在 w3.org 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58804963/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com