Have you ever wondered why there are also attributes in XML and not just elements, causing many never-ending "element vs attribute" discussions?

And why is XML so redundant - repeating the tag name in the ending tag, thus making the document much larger?

I asked Charles Goldfarb, the author of SGML - the original format from the 1960s (already had <tags> and attributes) from which XML and HTML were derived.

He was very kind to reply to me. Enjoy:



- In <elem>text</elem>, why repeat "elem" for the second time? In fact, there is an option in SGML that allows you to omit the element-type name from an end-tag, but it is rarely supported. (In XML the option does not exist at all.) The name is there primarily for the convenience of humans debugging the markup, as there are large document types, such as aircraft maintenance manuals, where elements can nest very deeply.