3 ms·
HTML5 has an XML serialization, so if you really must you can use XHTML5 today. But I think for most people it is in general a bad idea. XHTML parsed as XML me
by Joeri 5y ago
HTML5 has an XML serialization, so if you really must you can use XHTML5 today.
But I think for most people it is in general a bad idea. XHTML parsed as XML means that anything that mashes together strings to generate a webpage, like much of webdev, is prone to generating invalid XML due to bugs in the code, and this in turn leads to catastrophic failure where the page doesn’t just have errors but fails to render entirely. During the period where people were swayed by the XHTML proponents’ arguments it was commonplace for me to visit a website and see only an XML parsing error.
XHTML parsed according to custom rules that are forgiving for errors yet consistent and straightforward to implement would have been a good idea, but nobody implemented it to my knowledge. Luckily HTML5 does specify such a forgiving parsing system, where pretty much any random sequence of bytes can be parsed consistently.