Standard Generalized Markup Language (SGML) Introduction

SGML is the forerunner of HTML and XML. It was invented in the 1960s and fully standardized by the ISO in 1986.

The markup looks a lot like XML or HTML — angle brackets are used to define opening and closing tags, which set off various elements of a document. Like XML, SGML is open-ended — you can define any set of element tags and specify them using a Document Type Definition. SGML parsers can then validate an SGML document against the DTD.

Until HTML5, HTML was considered an application of SGML — there were even SGML DTDs that defined HTML. HTML5 moved away from SGML and is now its own standard.

HTML wasn't the only important use for SGML. Because it promised interoperability and stability, it was widely adopted by government, military, industry, and large enterprises. It has since been largely replaced by XML, which is similar in format and philosophy, but easier to work with.

SGML Tutorials

Additional Information and Reference

SGML Tools

  • OpenJade is an implementation of DSSSL, Document Style Semantics and Specification Language, which is an ISO standard for formatting SGML documents. OpenJade includes OpenSP, which is the only viable Open Source SGML parser available.

Books on SGML

  • Practical SGML (2013) by Eric van Herwijnen is one of the most recent books available on SGML, which also make it one of the most practical in terms of relevant tooling and contemporary examples.
  • PARSEME.1st: SGML for Software Developers (1997) by Sean McGrath emphasizes using SGML documents in a software system, rather than primarily for human consumption. The ideas in this book prefigure much of the XML ecosystem that would develop within a few years.
  • SGML and HTML Explained (1997) by Martin Bryan is the renamed second edition of SGML: An Author's Guide. This book provides an accessible explanation of SGML's features and capabilities, and how HTML implemented SGML.
  • Practical Guide to SGML/XML Filters (1998) by Norman E Smith provides in-depth information about the differences between SGML and XML, and how to translate data between formats.
  • The SGML Implementation Guide: A Blueprint for SGML Migration (1995; reprinted in 2013) by Travis and Waldt focuses on implementing SGML as an authoring and publication tool in businesses and large enterprises.
  • ABCD…SGML: A User's Guide to Structured Information (1995) by Liora Alschuler is intended as a non-technical introduction to the power and promise of SGML for document management. Of particular historical interest today is the number of case studies describing real organizations that adopted SGML.
  • Developing SGML DTDs: From Text to Model to Markup (1995) by Maler and El Andaloussi is a guide to creating DTD specifications for SGML documents.
  • The SGML Handbook (1991) by Charles F Goldfarb is the definitive reference book on SGML, by the language's inventor. This book contains the entire text of the ISO specification, along with detailed annotations by Goldfarb. Not a book for beginners, but essential reading for serious SGML developers and researchers.

Summary

SGML is mostly obsolete today outside of legacy systems. It does still get a lot of use in government agencies like the Library of Congress and highly regulated international industries like aeronautics. But even here, SGML is slowly being phased out in favor of XML.

What makes SGML really interesting is not how it is used today, but the revolution that is spawned. SGML gave birth to HTML, which had a deep impact on the evolution of the World Wide Web. It also gave rise to XML, which has made the world's data compatible and interoperable in ways few people imagined possible.


Further Reading and Resources

We have more guides, tutorials, and infographics related to coding and website development:

HTML for Beginners — Ultimate Guide

If you really want to learn HTML, we've created a book-length article, HTML for Beginners — Ultimate Guide And it really is the ultimate guide; it will take you from the very beginning to mastery.