When I read the HTML 4 Specification.
The document says :
Each markup language defined in SGML is called an SGML application. An SGML application is generally characterized by:
- An SGML declaration.
- A document type definition (DTD).
- A specification that describes the semantics to be ascribed to the markup. This specification also imposes syntax restrictions that cannot be expressed within the DTD.
- Document instances containing data (content) and markup. Each instance contains a reference to the DTD to be used to interpret it.
From above paragraph, My understanding is the HTML
is an SGML application
, Is it right?
And I know there are three types(Traditional, Strict and Frameset) of DTD for the HTML4
(no DTD for HTML5). so for the below sample of Html. What is the DTD type? Thanks.
<Html>
<head>
</head>
<body>
<p>the test html</p>
</body>
</Html>
1
From HTML 2.0 to HTML 4.01, HTML was nominally defined as an SGML application, as described in the quotation from the HTML 4.01 spec. It was never implemented that way. At least there has never been any published software that actually implements HTML as an SGML application. This is reflected in clause B.3.3 SGML features with limited support of the spec; it described features “that aren’t widely supported by HTML user agents”, which is a gross understatement; strike out that “widely”.
The sample does not contain any document type declaration (doctype
declaration), so it does not specify any DTD. It is not a conforming HTML 4.01 document, since HTML 4.01 requires that one of three document type declarations be used (and it makes the title
element mandatory). Strictly speaking, it is not HTML at all, though browsers will happily treat it as HTML. Formally, that piece of code is an SGML document, since SGML does not require the use of a document type declaration. But as such, it has no meaning; it is pure syntax.
3