Does A syntax error in XHTML stops the rendering of the document? whereas a syntax error in HTML would be ignorned and the document fully rendered?
Asked
Active
Viewed 77 times
0
-
Hi, please see: https://duckduckgo.com/?q=xhtml+vs+html&t=ffab&atb=v158-1&ia=web – Stefan Jun 12 '19 at 12:43
-
1In general `yes, no`, in practice: `no, yes` XD – Stefan Jun 12 '19 at 12:43
-
@zero3nna while this post's question text is indeed almost a verbatim duplicate of the former one's you linked, the old post is closed and its answers are not really informative, exhaustive, to the point, particularly SO-worthy, or otherwise helpful are they? – imhotap Jun 12 '19 at 15:59
-
If depends on how you define syntax errors. Well-formedness errors are definitely a deal-breaker in XHTML. Other syntax errors, like misspelled attribute names, not so much. Also, to answer the question in the title, there are many differences; see also [this answer](https://stackoverflow.com/a/56262793/1016716). – Mr Lister Jun 12 '19 at 19:03
1 Answers
1
HTML (HTML5 as specified by https://www.w3.org/TR/html52/ and https://whatwg.org/) defines such a large set of error recovery rules that almost anything is accepted as HTML5, even though it might not be the document structure the author had in mind. OTOH, when parsing HTML5 with general-purpose, strict markup tools such as SGML, then the parser has to stop at unrecoverable errors, just as with parsing XHTML using XML parsers. The error rules specified in the HTML5 spec are there for defining common browser (and in particular, security-oriented) behaviours in the presence of erroneous documents; they aren't recommendations for authors.

imhotap
- 2,275
- 1
- 8
- 16