SGML

Module: M2-R5: Web Design & Publishing

Chapter: Web Publishing

📘 Introduction to SGML

SGML (Standard Generalized Markup Language) is a standard for defining generalized markup languages for documents. It was developed by ISO (International Organization for Standardization) in 1986 and forms the foundation for HTML and XML.

SGML itself is not a programming language; rather, it is a meta-language used to define other markup languages such as HTML and XML.

⚙️ Key Features of SGML

  • Defines document structure and content using tags and attributes.
  • Provides flexibility to create custom markup languages.
  • Separates document content from its formatting or display.
  • Ensures documents are platform and application independent.
  • Supports reusable and maintainable document structures.

🏗️ Structure of an SGML Document

An SGML document generally consists of three main parts:

  • Document Type Definition (DTD): Defines the structure, elements, and attributes of the document.
  • Document Instance: Contains the actual content marked with tags defined in the DTD.
  • SGML Declaration: Specifies syntax rules and character set details.
<!DOCTYPE document SYSTEM "doc.dtd">
<document>
  <title>Example SGML Document</title>
  <body>
    <para>This is a paragraph inside an SGML document.</para>
  </body>
</document>
          

✅ Advantages of SGML

  • Highly flexible and customizable markup system.
  • Allows creation of domain-specific markup languages.
  • Supports large and complex documents.
  • Ensures long-term data preservation and portability.

❌ Disadvantages of SGML

  • Complex syntax, making it difficult to learn and use.
  • Requires specialized software for parsing and editing.
  • Not suitable for small or simple web pages.

🌐 Relation of SGML with HTML and XML

  • HTML: A simplified version of SGML designed for web page creation and display in browsers.
  • XML: A flexible markup language derived from SGML, used for data storage and exchange.

Both HTML and XML follow SGML’s basic tagging principles but are easier to use for specific applications.

Quick Links