以下声明出现在 html 4.01 dtds 中
<!ELEMENT STYLE - - %StyleSheet -- style info -->
(参见 http://www.w3.org/TR/REC-html40/sgml/dtd.html 在 strict.dtd 和 loose.dtd 中)
显然,;
在 %StyleSheet
之后丢失了。引用应该是 %StyleSheet;
但这是神圣 html 的官方 dtd - 迄今为止所有 dtd 中最重要的 dtd - 那么那里发生了什么?这样的实体引用是否有效?
最佳答案
在 HTML 4.01 DTD 中没有分号有效。这是 W3C 的 HTML 4.01 Specification - On SGML and HTML 的摘录:
... Instances of parameter entities in a DTD begin with "%", then the parameter entity name, and terminated by an optional ";".
在 XHTML DTD 中,它不会有效;他们遵循此建议(因为 XHTML 是 XML):Extensible Markup Language (XML) 1.0 (Fifth Edition) - Character and Entity References :
... Definition: Parameter-entity references use percent-sign (%) and semicolon (;) as delimiters.
关于html - 这是有效的 DTD 吗? (官方 html 4.01 dtd),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2858770/