4 ms·
What kind of HTML parser? A SGML one or a HTML5 one? I'm really sad that they didn't go with a XML base for HTML5.
by bhaak 6y ago
What kind of HTML parser? A SGML one or a HTML5 one?
I'm really sad that they didn't go with a XML base for HTML5.
- lucideer 6y ago> I'm really sad that they didn't go with a XML base for HTML5. I'm really sad that they didn't evangelise an XML base for HTML5, and that many HTML5-ish tools don't explicitly support XML, but it's not strictly true that they didn't go for an XML base for HTML5[0][1] [0] https://html.spec.whatwg.org/multipage/xhtml.html https://html.spec.whatwg.org/multipage/xhtml.html [1] https://www.w3.org/TR/html-polyglot/ https://www.w3.org/TR/html-polyglot/
- bhaak 6y agoThat's just HTML5 rewritten as a well formed XML document. HTML5 does not describe well formed XML. That you can put the same information of a HTML5 document into a XML document doesn't help much if most of the HTML5 documents out there are not polygot.
- chrismorgan 6y agoBut the point is that XML syntax is still a thing, supported by all browsers (and it’s reasonable to expect that support to remain as long as HTML remains). See also https://html.spec.whatwg.org/multipage/introduction.html#html-vs-xhtml https://html.spec.whatwg.org/multipage/introduction.html#htm...: > When a document is transmitted with an XML MIME type, such as application/xhtml+xml, then it is treated as an XML document by web browsers, to be parsed by an XML processor. Authors are reminded that the processing for XML and HTML differs; in particular, even minor syntax errors will prevent a document labeled as XML from being rendered fully, whereas they would be ignored in the HTML syntax. HTML does use an XML base (elements, attributes, namespaces, &c.), it just doesn’t use an XML parser most of the time. But the XMLness is easily observed in various DOM APIs.
- lucideer 6y agoIt doesn't help from a client perspective, but depending on your page delivery pipeline could be of potential help for some from a server perspective.
- lifthrasiir 6y ago> What kind of HTML parser? A SGML one or a HTML5 one? I intended the latter. In fact I'm a bit surprised that I have ever been asked for this, I thought "HTML" nowadays exclusively refers to HTML5...
- bhaak 6y agoI would have expected the former. Given that one of the rationales of HTML5 was "simpler parsing". I'm obviously not uptodate with the HTML5 parsing. But why should I? Who writes HTML by hand these days? The SGML heritage of HTML 4.01 and earlier lead to some gruesome legal constructs that look surprisingly similar to your examples. Looks like every generation has to make their own mistakes.