SGML

From Canonica AI

Introduction

The Standard Generalized Markup Language (SGML) is a markup language standard, ISO 8879, that was developed and standardized by the International Organization for Standardization (ISO) in 1986. It is a descriptive markup language that defines the structure and content of a document, rather than its appearance. SGML is the parent language of both HTML and XML, and has been instrumental in the development of the modern web.

History

SGML's origins can be traced back to the 1960s, when IBM developed the Generalized Markup Language (GML) as a way to manage the increasing complexity of documentation. GML was the first markup language to separate the content of a document from its presentation, a concept that would later become fundamental to the World Wide Web. In the late 1970s, the American National Standards Institute (ANSI) formed a committee to develop a standard based on GML. This committee, which included representatives from IBM, the U.S. Department of Defense, and other organizations, eventually developed the SGML standard, which was adopted by the ISO in 1986.

A vintage computer displaying SGML code.
A vintage computer displaying SGML code.

Structure and Syntax

SGML is based on the concept of elements, which are defined by tags. An element can contain text, other elements, or both. The start and end of an element are marked by start tags and end tags, respectively. For example, in the element

This is a paragraph.

,

is the start tag,

is the end tag, and "This is a paragraph." is the content of the element. SGML also supports attributes, which provide additional information about an element. Attributes are included in the start tag of an element, and consist of a name and a value. For example, in the element

This is a paragraph.

, align="center" is an attribute that specifies the alignment of the paragraph.

Document Type Definition

A key feature of SGML is the Document Type Definition (DTD), which defines the structure and syntax of a document. The DTD specifies the elements that can be used in a document, the attributes that can be associated with each element, and the hierarchical relationships between elements. This allows for a high degree of flexibility and customization, as different types of documents can have different DTDs.

Applications

SGML has been used in a wide range of applications, from technical documentation to electronic publishing. One of the most well-known applications of SGML is the DocBook standard, which is used for writing technical documents and books. Another important application is the Text Encoding Initiative (TEI), which uses SGML to encode and represent texts in the humanities and social sciences.

Legacy

Although SGML is no longer widely used, its influence can be seen in many modern technologies. HTML, the language used to create web pages, is a simplified version of SGML. XML, a more streamlined and flexible markup language, is also based on SGML. These languages have in turn influenced the development of many other technologies, from web services to mobile apps.

See Also