html-parser-book icon indicating copy to clipboard operation
html-parser-book copied to clipboard

Clarify SGML vs SGML (ENR+WWW) difference with "/>"

Open zcorpan opened this issue 4 years ago • 0 comments

https://htmlparser.info/introduction/#sgml--early-html

As an interesting aside, when using the XML "/>" syntax in HTML, according to SGML rules it would trigger the SHORTTAG feature. When used on a void element, the slash just marks the end of the start tag, and the ">" is text content. Therefore, the following are equivalent:​

<link rel=​"stylesheet" href=​"style.css" /> <link rel=​"stylesheet" href=​"style.css">>

See https://news.ycombinator.com/item?id=27312143

Just skimming through the intro chapter I already spotted inaccuracies regarding SGML. For example:

The following are equivalent: <link rel="stylesheet" href="style.css" /> [and] <link rel="stylesheet" href="style.css">>

No they're not. The author should study the 1998 WebSGML adaptations to ISO 8879 (the SGML spec), and in particular the NETENABL IMMEDNET feature.

zcorpan avatar Sep 09 '21 00:09 zcorpan