4 ms·
XHTML was ditched on the web, sure, but it survives in ePub.
by robin_reala 5y ago
XHTML was ditched on the web, sure, but it survives in ePub.
- vbezhenar 5y agoXHTML was not ditched on the web, it's supported by all major browsers, at least for now, and I'm not aware of any plans to deprecate it.
- krapp 5y agoIt was ditched on the web because no one on the web is using it. Everyone would rather have sites that fail gracefully on markup errors than crash in the browser.
- acdha 5y agoIt was never widely used, however, and in many cases those documents were parsed as HTML because the server was never configured correctly — I believe actual correct usage is well under 1% – so I would not be making any new investments in that direction. The big thing I'd be curious about is what happens when new features are added: do they get added to the XHTML parsers as well or does that become a legacy path drifting behind the main web platform? I believe there were already some issues with Chrome along those lines when they added JS modules, for example.
- WorldMaker 5y agoThe XHTML 2.0 "standard" was ditched on the web as no major browsers wanted to support it (and mostly still don't [1]). Also, most browsers today no longer support XHTML 1.x "Strict" modes, the errors they surfaced, and instead just laxly parse all XHTML 1.x with the same parsers they use for "HTML5". (IE11 I believe was the last browser with XHTML "Strict" support and used a proper XML parser and error reporting when parsing XHTML.) [1] Outside of how XHTML 2.0 influenced HTML5's list of "semantic DIVs" the tags like ARTICLE and SECTION that don't have any meaningful semantics in current browsers but are nice when you get bored of surrounding everything in DIV. XHTML 2.0's standard attached actual meanings to those tags and had a lot of specified behavior for how those tags would operate. The only surviving "tag behavior" from XHTML 2.0's plan was DETAILS, I believe. I also believe the exact lists of tags are disjoint and XHTML 2.0 had tags that didn't even make into the official "semantic DIV" bucket, are out of spec in HTML5, but HTML5 browsers will mostly just ignore and fallback to treating unknown tags as fallback DIVs anyway.
- vbezhenar 5y agoHere's example of invalid XHTML file with missing `</p>`: https://vbezhenar.com/test-invalid.xhtml https://vbezhenar.com/test-invalid.xhtml And fixed: https://vbezhenar.com/test-valid.xhtml https://vbezhenar.com/test-valid.xhtml It works in Chrome for me, parsing failed as expected on the invalid file. Also you can't use document.write from JS, so DOM has special treatment for XHTML as well.
- aequitas 5y agoStill survives in RSS as well, which seems to be making a comeback.
- Zardoz84 5y agoAnd RDF, OAI EDM, Dublin core, etc