> Well an XHTML parser (and serializer) is a lot simpler
Perhaps, but a combined html and xhtml parser is more complex than just a html parser. Since html already is entrenched, xhtml would be in addition to html, not instead of.
XML/XHTML is a fairly strict language syntax wise compared to HTML, tags are either explicitly self-closing i.e. <img/> or terminated with a matching closing-tag, no exceptions.
HTML has special rules depending on the tag's type, ie a bunch of them are just written (<img>) and the parser doesn't even really want to see a matching closing tag, or tags like <script> that has a special mode that stops being a HTML parser up until </script> is found. (1)
A HTML parser can become a XML parser by disabling a bunch of special-features and supporting self-closing tags (depending on XML level).
A XML parser needs a ton of "hacks" to become a HTML parser.
Also browsers needs an XML parser anyhow to support svg that's an xml-based format, also the DOM spec is written to support namespaces's like XML.
XSLT did complicate things, and most importantly it seems many relied on that one old implementation written in the 90s that was a swiss-cheese when it came to security concerns that nobody wanted to spend money on maintaining.
The idea would be to eventually deprecate "legacy" html, of course.
Whether that kind of backwards-incompatible breakage would ever become acceptable is a completely different story. But we ditched Flash, ActiveX, Silverlight, and Java applets, so who knows what could have been!
Who would want to use a browser which couldn’t render html? Even if a better format arrived, there are millions of already existing html pages which people would want to be able to read.
All the problems of XML, such as the billion laughs attack, and reading local files as DTDs. It should have been XML-compatible strict parsing without pulling in all of XML's complexity that only hackers ever use.
With the benefit of hindsight, if the web had been that way from the beginning, I think we would have been better off. The moment you tested your content in any browser, you'd immediately see if it was broken.
But it wasn't something that could get introduced later, after all the broken content that already existed.
With all respect - the opposite is true. The web succeeded because HTML and HTTP are easy standards easily writable by humans with text editors. HTML was writable by non-programmers.
The low barrier to authoring was very important. No tools needed except notepad and a browser. Syntax easy to understand and write by hand.
But I don’t think the ambiguous html parsing made it easier. If anything it made it more difficult since you had to test in multiple browsers. Eg a table which was not properly closed would render in IE but not render in Netscape.
That's not obviously so. The adoption of JS wasn't particularly hindered by the fact that users have to match their brackets and generally avoid syntax errors.
Perhaps, but a combined html and xhtml parser is more complex than just a html parser. Since html already is entrenched, xhtml would be in addition to html, not instead of.