The Standard Generalized Markup Language (SGML) is a metalanguage in which one can define markup languages for documents. SGML is a descendant of IBM's Generalized Markup Language (GML), developed in the 1960s by Charles Goldfarb, Edward Mosher and Raymond Lorie (whose surname initials were used by Goldfarb to make up the term GML[1]). SGML and GML should not be confused with the Game Maker scripting language, or with the Geography Markup Language developed by the Open GIS Consortium.
SGML provides a variety of markup syntaxes that can be used for many applications. By changing the SGML Declaration one does not even need to use "angle brackets" although they are the norm – part of the concrete reference syntax defined in the standard (GML used a colon to introduce a tag, a period to end it, and 'e' to indicate an end tag: :xmp.thus:exmp., and SGML is flexible enough to accept that grammar too).
SGML was originally designed to enable the sharing of machine-readable documents in large projects in government, legal and industry, which have to remain readable for several decades—a very long time in information technology. It has also been used extensively in the printing and publishing industries, but its complexity has prevented its widespread application for small-scale general-purpose use.
Primarily intended for text and database publishing, one of its first major applications was the second edition of the Oxford English Dictionary (OED), which was and is wholly marked up in SGML.
HTML was originally designed based on SGML tagging but without SGML's emphasis on rigorous markup. It was later reformulated (at version 2.0) to be an application of SGML, although there's some debate on whether it ever actually became one. The charter for the recently revived World Wide Web Consortium HTML Working Group goes so far as to say, "the Group will not assume that an SGML parser is used for 'classic HTML'".
XML is a simplified rework of SGML, which is designed so to make the XML parser much easier to implement, compared to an SGML parser. One consequence is that an XML parser is much less forgiving to erroneous XML code. A consequence of the ease of implementation is that XML has replaced SGML virtually completely. Contributing to this is the fact that few SGML aware programs existed when XML was created. The number of XML applications today are numerous. XML also has more lightweight internationalization. XML is used for general-purpose applications, such as the Semantic Web, XHTML, SVG, RSS, Atom, XML-RPC and SOAP.
Another markup language originally created as an application of SGML is DocBook, designed for authoring technical documentation. DocBook is now also available as an XML application.
There are also a number of languages that are related in part to SGML and XML, but, because they cannot be parsed or validated or otherwise processed using standard SGML and XML tools, cannot be considered to be applications of SGML or XML. One example is the Z Format, a language designed for typesetting and documentation.