Toapi – Let any web site provide APIs
As HN sometimes likes to pretend XHTML is the answer to all problems with HTML and the Semantic Web would have worked if only developers hadn&#x27;t been such idiots at the time, let me reiterate a few things:<p>First off, a full disclosure: I was (and in principle still am) a big fan of web standards and was a strong believer in XHTML and XHTML 2. I thought XML was going to save us all.<p>Here&#x27;s a hard truth about HTML: it was never about semantics. HTML was created to connect digital documents. Most of the initial tags were fairly ad hoc and loosely based on CERN&#x27;s SGML guide, as is still evident from the awkward h1-h6 elements[0].<p>The biggest thing the first W3C spec[HTML32] added to HTML? The FONT element (and arguably APPLET because Java applets were a thing). Note that it really didn&#x27;t add any elements for additional semantics. It was just another iteration on HTML that merged minor changes to HTML 2.0 with some proprietary extensions (mostly by Netscape).<p>HTML 4 followed shortly after and promised to rid the world of presentational markup because CSS had become somewhat widely supported (having won against Netscape&#x27;s JavaScript StyleSheets, which rapidly faded into obscurity). It attempted to do this in a backwards compatible way by defining three different DOCTYPEs: Strict, Transitional and Frameset.<p>At this point it&#x27;s worth emphasising what has become the most important mantra in web standards: Don&#x27;t Break the Web. HTML 4 Strict was trying to enable a break as an opt-in. The website would behave exactly the same way but the DOCTYPE would tell browsers the page doesn&#x27;t use certain elements the spec defined as deprecated.<p>Of course by this point web browsers no longer cared about SGML and were purpose built to handle HTML and be able to render whatever junk a content author would throw at them. The Browser War was raging (Netscape still believed it could make money selling commercial licenses for their Navigator -- yes, surprise, Netscape Navigator wasn&#x27;t free for commercial use) and if your browser couldn&#x27;t render a page but a competitor&#x27;s could, that&#x27;s where users would go.<p>So in practice Strict vs Transitional didn&#x27;t make any difference except as an indicator to how sloppy the author likely was with their markup. Eventually Internet Explorer started using it as a shibboleth to determine whether to fall back to &quot;quirks mode&quot; or follow the standards more closely but deprecated elements would still render in strict mode and the only thing that cared were automated validators that spit out pretty badges.<p>When the W3C created XHTML[XHTML1] the entire point was to drag HTML into the XML ecosystem the W3C had obsessively created and that just wasn&#x27;t getting much traction on the web. Instead of having to understand SGML, browsers could just learn XML and they&#x27;d be able to handle XHTML and all the other beautiful XML standards that would enable the Semantic Web and unify proprietary XML extensions and open standards side by side.<p>Of course the only flaw in that logic was that browsers <i>didn&#x27;t</i> understand SGML. Adding support for XML actually meant implementing an additional language in addition to HTML and as XML had much more well-defined implementation requirements, this among other things meant that web pages that weren&#x27;t well-formed XML would have to break <i>by definition</i> and browsers were only allowed to show a yellow page of death with the syntax error.<p>This is why browsers for the most part ended up ignoring XHTML: Firefox supported XHTML but developers were upset with WYSIWYG tools breaking their websites in Firefox and because ensuring all your output is proper XML is hard, the easier fix was to just send your &quot;XHTML&quot; tag soup with the HTML mime type so Firefox would just handle it as HTML (which all the other browsers did anyway -- except Internet Explorer, which for once did the right thing and dutifully refused to render proper XHTML because after all it only understood HTML, not XHTML).<p>But as I said: XHTML wasn&#x27;t about semantics. In fact, XHTML 1.0 copied the exact same Transitional&#x2F;Strict&#x2F;Frameset model HTML 4 had introduced, allowing developers to write the same sloppy markup (but now with more slashes). And the W3C even specified how authors could make sure their XHTML could be parsed as HTML tag soup by non-XHTML browsers (which led to millions of developers now thinking closing slashes in <i>HTML</i> are &quot;more standards compliant&quot;).<p>A few moments later the W3C created XHTML 1.1[XHTML11], which was mostly just XHTML 1.0 Strict but now split into multiple specs to make it easier to sneak other XML specs into XHTML in the future. Again, nothing new in terms of semantics.<p>Meanwhile, work began on XHTML 2.0[XHTML2] which should never see the light of day. XHTML 2.0 was finally going to be a backwards incompatible change to HTML, getting rid of all the cruft (more than XHTML 1.1 had tried to shake off by dropping Transitional, even promising to kill a few darlings like h1-h6) and replacing lots of HTML concepts with equivalents already available in other XML specs. XHTML 2.0 would finish the transition that XHTML had started and replace HTML with the full power of the XML ecosystem.<p>Except obviously that was not going to happen. Browser vendors for the most part had given up on XHTML 1 because authors had no interest in buying into a spec that provided no discernable benefits but would introduce a high risk of breaking the entire website or requiring workarounds for other browsers. Netscape was dead, Internet Explorer had stabilised and didn&#x27;t seem to be going anywhere, the Browser War that had fueled innovation was largely over.<p>But even so, XHTML 2 wouldn&#x27;t really have added anything in terms of semantics. That wasn&#x27;t the goal of XHTML 2. The goal of XHTML 2 was to eliminate redundancies within the new XML&#x2F;XHTML ecosystem, generalise some parts of XHTML into reusable XML extensions and specify the rest in a way that integrates nicely with everything else (leaving the decision what XML extensions to support up to the implementors).<p>The real game changer in semantics were Microformats[MFORM]. Because the W3C was too slow to keep up with the rapid evolution of the real web and too academic to be aware of real world problems, the web community came up with ways to use the existing building blocks of HTML to annotate markup in a machine-readable way, building on existing specs -- all this without XML.<p>When browser vendors finally gave up relying on the W3C&#x27;s leadership for HTML and began working on a new HTML spec[HTML] under WHATWG, the main lesson was to pave the cowpaths. Instead of relying on authors to explicitly add annotations (although that is still possible using ARIA[ARIA]) various semantic elements like MAIN and ASIDE finally made it into the language. But the most important change was that the spec finally defined the error handling browsers had previously implemented inconsistently.<p>But again, even with the new HTML spec, HTML&#x27;s goal never was to be able to declare semantics for any possible document. Yes, you can embed metadata (and the W3C still likes to push RDF-XML as a solution to do that in HTML) but the core elements are only intended to be good enough to provide sufficient semantics to structure generic documents.<p>Domain-level semantics are still left as an exercise to the reader. And anyone who&#x27;s tried to actually parse well-formed, valid, well-structured HTML for metadata can tell you that even for generic documents the HTML semantics just aren&#x27;t sufficient.<p>Sorry for the lengthy history lesson, but it never ceases to amaze me how rose-tinted some people&#x27;s glasses are when looking at the mythical Semantic Web, early HTML and the XML ecosystem. I didn&#x27;t even go into how much of a mess the latter is but I think my point stands even so.<p>[0]: The initial list of HTML tags[TAGS] allowed for &quot;at least six&quot; levels of heading but the RFC[HTML2] only defined h1-h6, but it also explicitly stated how each level was to be rendered. The original SGML guide[SGML] the tag list was loosely based on used up to six levels of headings in its examples. So in a nutshell, the reason there are six is likely a mix of &quot;good enough&quot; and nobody being able to figure out how to meaningfully define the presentation for anything beyond h6.<p>[SGML]: <a href="http:&#x2F;&#x2F;cds.cern.ch&#x2F;record&#x2F;997909&#x2F;files&#x2F;cer-002659963.pdf" rel="nofollow">http:&#x2F;&#x2F;cds.cern.ch&#x2F;record&#x2F;997909&#x2F;files&#x2F;cer-002659963.pdf</a><p>[TAGS]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;History&#x2F;19921103-hypertext&#x2F;hypertext&#x2F;WWW&#x2F;MarkUp&#x2F;Tags.html" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;History&#x2F;19921103-hypertext&#x2F;hypertext&#x2F;WWW&#x2F;...</a><p>[HTML2]: <a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc1866" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc1866</a><p>[HTML32]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;REC-html32" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;REC-html32</a><p>[HTML4]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;REC-html40-971218&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;REC-html40-971218&#x2F;</a><p>[XHTML1]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;2002&#x2F;REC-xhtml1-20020801&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;2002&#x2F;REC-xhtml1-20020801&#x2F;</a><p>[XHTML11]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;2010&#x2F;REC-xhtml11-20101123&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;2010&#x2F;REC-xhtml11-20101123&#x2F;</a><p>[XHTML2]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;2010&#x2F;NOTE-xhtml2-20101216&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;TR&#x2F;2010&#x2F;NOTE-xhtml2-20101216&#x2F;</a><p>[MFORM]: <a href="http:&#x2F;&#x2F;microformats.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;microformats.org&#x2F;</a><p>[HTML]: <a href="https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;</a><p>[ARIA]: <a href="https:&#x2F;&#x2F;www.w3.org&#x2F;WAI&#x2F;intro&#x2F;aria" rel="nofollow">https:&#x2F;&#x2F;www.w3.org&#x2F;WAI&#x2F;intro&#x2F;aria</a>