What is SGML?


ISO 8879 -standard (1986).

SGML is language for describing documents logical structure. Each part of the document content has different role in the document, e.g. DATE has different role than HEADING. Different parts of the document are called elements. Elements can be composed of other elements (subelements). Each element is marked with identifier, usually called tag, that explicitly tells where element starts and where it ends. Tag starts with <, ends with > and between is elements name. Tag that identifies start of the element is called start tag e.g <PARA> and end of the elemet is marked with end tag e.g. </PARA>. In some cases end tag can be omitted like in HTML tag <IMG>.

Structure of the document is defined in a hierarchical way, and can be viewed as a tree.

SGML separates logical structure from physical (or lay-out) structure, tags tell what element is instead of telling how element should look like or to be processed.

SGML is also metalanguage, i.e. it can be used to create document type definitions for different document classes. One of the most used SGML document type is HTML (HyperText Markup Language).