3 ms·
> DTDs are one of the ugliest thing ... not sold on the whole "HTML-style error-recovery" I think there might be a misconception here. HTML5 does have some ad-
by tannhaeuser 5y ago
> DTDs are one of the ugliest thing ... not sold on the whole "HTML-style error-recovery"
I think there might be a misconception here. HTML5 does have some ad-hoc rules around script, style, and noscript elements, but the vast majority of tag inference it does is straight from SGML, from which both HTML and XML are derived. Tag inference in SGML is driven by (parent) element content models and per-element tag omission indicators. For example, a minimal HTML doc can look as simple as
<title>XYZ</title>
<p>body text
and SGML and HTML infer omitted tags to arrive at
<html>
<head>
<title>XYZ</title>
</head>
<body>
<p>body text</p>
</body>
</html>
The concept of hierarchically structuring a partially tagged text document, possibly with custom Wiki syntax a la markdown, is pretty fundamental to SGML-style angle-bracket markup, and also required to unambiguously assign an address (path) to every node such that it can be styled using eg CSS. Since it requires declarations or a hard-coded vocabulary, it'd be difficult to remove DTDs/element declarations.
SGML is formalized in ISO 8879:1986, and there's absolutely nothing vague or speculative about the kind of tag inference it does. It's just that most people don't seem to know SGML and come up with ad-hoc XML extensions that can't be taken seriously without reference and alignment within the greater SGML context when XML itself is specified as a proper SGML subset.
It's interesting that you'd be willing to trade processing instructions for XML namespaces. Most experts, including the article's author, seem to agree that namespaces and XML Schema are the worst XML offenders, taking the just gained simplicity of XML away on the spot.