I’ve seen it in several places and e.g. the Eclipse XML auto-formatting does it, too: Put a space before the closing />
of an empty element.
Having
<element attribute="value"/>
would be re-formatted as
<element attribute="value" />
Why would you do that? From the XML point of view it’s equivalent. Is it a convention? Is it for readability?
It is likely done to be safe with XHTML XML, which requires the space in some early XHTML browsers.
Better answer: Space Before Closing Slash?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With