The Relationship Between SGML, HTML, and XML

Programming team at work
Yuri_Arcurs/Getty Images

When you look at SGML, HTML, and XML, you could consider this a family grouping. SGML, HTML and XML are all markup languages. The term markup gets its root from editors making revisions to writers' manuscripts. An editor, when reviewing the content, will "mark up" the manuscript to highlight certain fields. In computer technology, a markup language is a set of words and symbols that highlight text to define it for a web document. For example, when creating an Internet page, you want to be able the separate paragraphs and put letters in a bold-face type. This is accomplished through a markup language. Once you understand the roles SGML, HTML and XML play in web page design, you will see the kinship these distinct languages have to each other. The relationship between SGML, HTML, and XML is a family bond that helps make websites work and web design dynamic.


In this family of markup languages, Standard Generalized Markup Language (SGML) is the parent. SGML provides a way to define markup languages and sets the standard for their form. In other words, SGML states what some languages can or cannot do, what elements must be included, such as tags, and the basic structure of the language. As a parent passes on genetic traits to a child, SGML passes structure and format rules to markup languages.


HyperText Markup Language (HTML) is a child, or application, of SGML. It is HTML that usually designs the page for an Internet browser. Using HTML, you can embed images, create page sections, establish fonts, and direct the flow of the page. HTML is the markup language that creates the form and appearance of the web page. Additionally, using HTML, you can add other functions to a website via scripting languages, such as JavaScript. HTML is the predominant language used for website design.


Extensible Markup Language (XML) is a cousin to HTML and a nephew to SGML. Although XML is a markup language and therefore part of the family, it has different functions than HTML. XML is a subset of SGML, which gives it rights that an application, such as HTML, does not have. XML can define applications of its own. Resource Description Format (RDF) is an application of XML. HTML is limited to design and does not have subsets or applications. XML is a pared down, or light, version of SGML, designed to work with limited bandwidth. XML inherited genetic traits from SGML but is created to make its own family. Subsets of XML include XSL and XSLT.