HTML vs. XML: What is the difference?
Many people think XML is just a way to add tags to HTML? This assumption is incorrect.
The following mantras were repeated at the XML conference held in Seattle in the Spring of 1998:
- HTML is display.
- XML is content.
- XML is not HTML.
XML is a subset of SGML
. XML is SGML made simpler and more accessible. It is sometimes referred to as "SGML Lite."
As such, XML qualifies as a meta-language
and can be used to write other languages. XML provides users with the ability to define their own set of markup tags— to write their own version of HTML, so to speak.
Why Markup Languages Are So Popular
Markup languages, such as SGML and HTML, have changed the nature of information. Thanks to
them, you can transport information across the planet and through all kinds of computer platforms and hosts. Your documents always retain their original structure and format. Presenting information no longer requires a specific machine. It does not matter whether you are writing on a UNIX box, a Macintosh, an IBM mainframe, or a PC. Markup languages such as SGML in particular make your text presentation transportable using the medium of http without changing its original appearance. You can write a biologicall treatise, a movie review complete with video and sound clips, or a multimedia presentation discussing a weaponized brown bear, and transport it without losing its structure, content, or format. SGML also makes your documents modular, interchangeable, and flexible. Hypertext takes advantage of this sort of flexible presentation of information. For example, if you click highlighted text in a help file on your PC, your computer display automatically jumps to information related to that text. For that event to happen, someone had to mark up or encode the related information. SGML provides the greatest flexibility possible for this sort of information interchangeability.
When you make documents into SGML documents, you insert tags around document structures, like titles and paragraphs, that an SGML processing system can recognize and reconstruct on demand. The tags provide a blueprint for an SGML processing system to build your document according to your original design, regardless of platform or processing environment.
Tags make your documents look somewhat unrecognizable when not seen through an SGML viewing tool, but tools for dealing with SGML documents are increasingly available.
- SGML: The Standard Generalized Markup Language is a system for organizing and tagging elements of a document.
SGML was developed and standardized by the International Organization for Standards in 1986. SGML itself does not specify any particular formatting; rather, it specifies the rules for tagging elements. These tags can then be interpreted to format elements in different ways.
- Meta-language: A language for defining the rules for other languages. XML is an example of a meta-language designed to define the rules for creating other mark-up languages.
(SGML) Standard Generalized Markup Language is a standard for how to specify a document markup language or tag set.
Such a specification is itself a (DTD) document type definition . SGML is not in itself a document language, but a description of how to specify one and is metadata.