This was the closest question to mine that I could find: Closing empty elements and other xhtml standards within HTML5 and it leaves me disturbed, alarmed!
I have for decades used XML / XSLT to generate web pages. At some point I just used xsl:output type xml, not even html or xhtml. I thought: HTML is XML (at least somehow). But now, as I'm back actually typing HTML I find myself teleported to the early 1990s or something, where I have to write
<script src="test.js"></script>
instead of just
<script src="test.js"/>
and
<input>
<br>
<img>
don't need to be closed at all.
I sometimes do
<div/>
<p/>
and now I notice that the />
is entirely ignored and the p sucked into the contents of the div, leading to all kinds of confusion.
Isn't there some mode I can set on top, or by content-type or whatever it is where I can tell the browser to parse my document correctly as XML? I tried to begin the file with:
<?xml version="1.0"?>
but to no avail.
It feels like I'm the only one in the world who has completely missed the boat after decades of building web applications.