XML Programming  «Prev 

Relationship between SGML, XML, and HTML

XML is a profile of an ISO standard SGML, and most of XML comes from SGML unchanged.
HTML is a subset of SGML and XML is a highly functional subset of SGML.
XHTML extends and subsets HTML.
Question: Does "one being a subset of another" mean that code in the first is also syntactically correct and semantically the same as in the second?
As in the sense of elementary set theory,
  1. are HTML, XML and XHTML all different subsets of SGML?
  2. do XML and HTML almost not intersect each other?
  3. is XHTML a superset of both XML and HTML?
XML is not a single Markup Language but a metalanguage to let users design their own markup language.
I was wondering how to understand XML and HTML are both subsets of SGML, but HTML is a markup language while XML is not a markup language but a metalanguage for designing markup languages?
Question: Are SGML and XHTML both also metalanguage for designing markup language?
As in both links mention that HTML is an applicaiton of SGML as well as a subset of SGML, and XHTML is an application of XML.

XML Corporate Portals
1) SGML is a superset of XML and HTML. SGML is a complex metalanguage .

2) XML is a subset of SGML. XML is a metalanguage but it is not as complex to work with as SGML. XML may be used to define other markup languages.

3) HTML is a markup language that was defined using SGML. HTML has a fixed set of tags that define how HTML documents are rendered. In a sense, HTML is an application of SGML. HTML is not a metalanguage.