Related
s
DOM
HTML
HTML5
MSXML
NAMESPACES
NOT SGML
SAX
SCHEMA
SGML
SVG
TEX
UNICODE
XML CHINESE
XML CONDENSED
XML DUTCH
XSL
A.6 Aren't XML, SGML, and HTML all the same
thing?
Not quite; SGML is the mother tongue, and has been used for describing thousands of different document types in many fields of human activity, from transcriptions of ancient Irish manuscripts to the technical documentation for stealth bombers, and from patients' medical and clinical records to musical notation. SGML is very large and complex, however, and probably overkill for most common office desktop applications.
XML is an abbreviated version of SGML, to make it easier to use over the Web, easier for you to define your own document types, and easier for programmers to write programs to handle them. It omits all the complex and less-used options of SGML in return for the benefits of being easier to write applications for, easier to understand, and more suited to delivery and interoperability over the Web. But it is still SGML, and XML files may still be processed in the same way as any other SGML file (see the question on XML software).
HTML is just one of many SGML or XML applications—the one most frequently used on the Web.
Technical readers will find it more useful to think of XML as being SGML−− rather than HTML++.
(in article <i7ll1362ib.fsf@hilbert.math.albany.edu>)
SGML is a category of document types, with a configurable shared syntax, most of which (like classic HTML) cannot be compiled to produce executable programs. XML is a subcategory of SGML with syntactic restrictions. For example, with XML the vocabulary of a document type is always case sensitive, while with SGML it may be either case sensitive or case insensitive. So, for example, classic HTML is an SGML document type, and XHTML+MathML is an XML document type.
While some document types correspond to document markup languages, other document types (like a CTAN catalog entry) are just for structured data[...]
I doubt seriously, however, that a computer language like C is in any reasonable sense equivalent to an SGML document type.
(Ed: In respect of this last paragraph, see question C.23, ‘How do I execute or run an XML file?’ and question A.13, ‘What is the difference between XML and C or C++ or Java?’.)