SGML

Standard Generalized Markup Language (SGML) is a formal system for building text markup languages. Any document can be thought of as consisting of content and markup. The markup information can give the structure and the formatting of the document. Structure tells how the document breaks down into parts - chapters, sections, paragraphs. Format governs the presentation like type of fonts and their sizes. Most text processing provide formatting or procedural markup. Using absolute values in formatting is restrictive.

On the other hand, if you have added information of the logical role of every element then you can later add procedural markup to those logical tags. We have now a separation of presentation from content. The advantage is that the same document can be rendered appropriately in different contexts. SGML is strictly descriptive and can interfaced to external procedural markup systems and style sheets. So SGML is a computer language rather than a data format. You need an SGML parser to read and analyze the document.

From SGML's viewpoint a document is a hierarchical structure of nested elements. All documents marked with the same hierarchy of elements are said to belong to a certain document type and are given in the document type definition (DTD). One particular application of SGML is HTML. The SGML declaration for HTML is embodied in its DTD that defines entities, elements, and the elements' attributes that make up the language.

HTML is an SGML application, yet majority of HTML users are quite comfortable using HTML without knowing DTD. SGML is an international standard. It has been used for various documentation projects around the world like XML. The DTD gives the ultimate answers to syntax related questions. SGML was designed to ensure document portability inspite of incompatible proprietary technologies.