The Standard Generalized Markup Language (SGML) is a standard markup definition for document structure, which help describe how we define markups. SGML is not in itself a document language, but a description of how to specify one. SGML defines rules for how a document can be described in terms of its logical structure (headings or paragraphs for example). SGML is known as a metalanguage because it provides a "language to describe a language." The SGML specification is a document type definition (DTD)
HTML is an example of an SGML-based language and there is a document type definition for HTML (that means that the current document is coded in a particular DTD called HTML). In this case, your browser is designed to handle text documents encoded with HTML tags. (Other programs could be developed that would handle HTML and other DTDs as well.)
Remember our discussion of content-based vs. physical tags? SGML is based on the idea that documents have structural and other semantic elements that can be described without reference to how such elements should be displayed. The actual display of such a document may vary, depending on the output medium and style preferences. Therefore SGML documents can be created by thinking in terms of document structure rather than appearance characteristics (remember that the documents can change over time). Furthermore, documents originally intended for the print medium can easily be re-adapted for other media, such as the computer display screen.
SGML documents are very portable because an SGML compiler can interpret any document by reference to its document type definition (DTD).
A document type definition (DTD) is a specific definition that follows the rules of SGML. A DTD is a specification that identifies what the markup codes are and how each is to be processed. By mailing a DTD with a document, any location that has a DTD "reader" (or "SGML compiler") will be able to process the document and display or print it as intended. This means that a single standard SGML compiler can serve many different kinds of documents that use a range of different markup codes and related meanings. The compiler looks at the DTD and then prints or displays the document accordingly.