SGML

HTML230116 DTD Reference

W3C HTML5(http://sgmljs.net/schemas/sgml-cms/w3c/html5.dtd)
DTD for W3C HTML 5 (deprecated); while the DTD itself is deprecated, the text describes the construction of the HTML 5 DTD in detail; see later versions for important revisions
W3C HTML5.1(http://sgmljs.net/schemas/sgml-cms/w3c/html51.dtd) (http://sgmljs.net/schemas/sgml-cms/w3c/html51mini.dtd)
Full DTD and Minimal DTD for W3C HTML 5.1 (superseded by HTML 5.2)
W3C HTML5.2 (http://sgmljs.net/schemas/sgml-cms/w3c/html52.dtd) (http://sgmljs.net/schemas/sgml-cms/w3c/html52mini.dtd)
Full DTD and Minimal DTD for W3C HTML 5.2 (superseded by HTML RD 200129)
HTML Review Draft 200129 (http://sgmljs.net/schemas/sgml-cms/w3c/html200129.dtd) (http://sgmljs.net/schemas/sgml-cms/w3c/html200129mini.dtd)
Full DTD and Minimal DTD for HTML Review Draft 200129; note the Minimal DTD is the declaration set resolved via the 'about:legacy-compat' system identifier in sgmljs.net SGML
HTML Review Draft 230116 (http://sgmljs.net/schemas/sgml-cms/w3c/html230116.dtd) (http://sgmljs.net/schemas/sgml-cms/w3c/html230116mini.dtd)
Full DTD and Minimal DTD for HTML Review Draft 230116 (experimental)
Note: the W3C HTML 5 series DTDs are deprecated and superseded by the HTML Review Draft (200129 and newer) DTDs. The current HTML RD 200129 Minimal DTD assumes SGML IMPLYDEF ELEMENT ANYOTHER behaviour with respect to undeclared elements as defined in ISO/IEC 8879:1986/Cor.2:1999(E) in support of SVG and MathML foreign vocabularies and custom elements. While IMPLYDEF ELEMENT ANYOTHER is supported by sgmljs.net SGML, it might not be by other SGML software such as OpenSP. If a minimal DTD for use with OpenSP is desired, use the legacy Minimal HTML 5.1 DTD. Note this only affects the minimal but not full DTD variants.

Overview

The Full WHATWG HTML RD2301 DTD, like former versions, is a transcription of WHATWG's HTML Review Draft specification prose published January 16th, 2023, into an SGML DTD. The Full DTD covers all elements of HTML, SVG, MathML, and the ARIA attributes, and its construction is described in the reference for the W3C HTML 5 DTD, with only modifications for the current version described in this document.

The Minimal WHATWG HTML RD2301 DTD, also like former versions, is a compact DTD containing only essential parsing rules for HTML. As only HTML's special rules for HTML void elements and enumerated attributes are included (others being admitted freely), the Minimal WHATWG HTML's DTD usefulness for validation purposes is limited. Instead, the purpose of the Minimal HTML DTD is to provide a minimal bundled declaration set for content parsing and production tasks for modern and idiomatic HTML in sgmljs.net and other SGML software with support for resolving declaration sets via catalog resolution.

Update for WHATWG HTML Review Draft 230116

Note this is an experimental DTD reflecting current HTML specification work but hasn't seen wide review. Going by the points mentioned in these release notes, there are in fact at least two known issues regarding the hidden attribute and the changed content model of the hgroup element, but also further incompatible changes related to the legend and param elements (see below).

The DTD based on the previous HTML Review Draft 200129 remains thus the recommended version, and the version resolved via about:legacy-compat in sgmljs.net SGML.

Changed elements

Changed the content model/inclusion constraint for hgroup (see initial comments about the so-called outlining algorithm), legend (again), and summary.

Removed the usemap attribute on the object element (again), and changed the content model of the object element, part of which involves removal of the param element from WHATWG HTML. As a consequence, and in line with other removals of elements allowing tag omission, the param element is now included as legacy element.

Note changed prose for tag omission rules and/or prohibited child content on the body and a element without material change to element declarations are reflected in comments only.

Global attributes

Added event handler attributes onbeforeinput, onbeforematch, oncontextlost, oncontextrestored, andonscrollend`.

Added global attribute inert.

Removed event handler attribute onabort.

The changed rules for the hidden attribute (applicable to any HTML element) which, no longer being a "HTML Boolean attribute" but an enumerated attribute with an additional permitted value of until-found instead, has the consequence that the long-standing and widely used practice of using attribute name omission with hidden, as described in eg mdn-hidden and also used within the HTML spec text itself, is no longer allowed according to sections 2.3.2 Boolean attributes and 2.3.3 Enumerated attributes. While this is believed unintentional and the authors of the HTML spec at https://github.com/whatwg/html may want to revise this change, it has no consequence for the SGML DTD, since attribute name omission is applicable to any enumerated attribute/attribute value, and not just those attributes whose only possible value happens to coincide with its name as in HTML "Boolean attributes".

Other Attributes

Added the disabled and blocking attribute on the link element.

Added the media attribute on the meta element.

Added the blocking attribute on the style element.

Added the width and height attributes on the source and canvas element.

Added the loading attribute on the img element.

Added the blocking attribute on the script element.

Removed the allowpaymentrequest attribute on the iframe element.