Re:SVG: The Good, the Bad and the Ugly
by goto11 on Saturday February 13, 2021 @10:23AM
(#26124074)
In HTML you can leave out the end tag in cases where they can be unambiguously inferred, like:
<p>First paragraph<p>Second paragraph</p>
P-element can't be nested, so a <p> will automatically close the previous p-element.
But this also means it is necessary to indicate the tag name in the closing tag. For example this would be ambiguous:
<div><p>Hello</>
It cannot be inferred if it is the div or p which is closed.
XML is of course different. Since all element have to be explicitly closed, repeating the tag-name in the close tag is in principle superfluous. I think it makes it easier to read though, at the cost of more effort to write.
But this also means it is necessary to indicate the tag name in the closing tag. For example this would be ambiguous:
It cannot be inferred if it is the div or p which is closed.XML is of course different. Since all element have to be explicitly closed, repeating the tag-name in the close tag is in principle superfluous. I think it makes it easier to read though, at the cost of more effort to write.