Compare/contrast HTML, XHTML, XML, and HTML5

Viewed 56985

Ok, so I'm not quite sure the difference between these languages. Could someone clarify? I know that XML has user-defined tag and html is pre-defined, but thats basically the extent of my knowledge.

I know that HTML5 is supposed to replace HTML, but wasn't XML supposed to do that as well? Basically, which languages here are a substitute for the other, and which complement? Does XML replace XHTML?

9 Answers

First, there was SGML, the conceptual ancestor of both HTML and XML, which is a

  • S tandard (ISO 8879:1986), so that disparate organizations and programs can exchange documents
  • G eneralized, so that users can define new tags
  • M arkup, so that document content can be augmented with structural information describing the content
  • L anguage, so that there's a grammar that defines the markup.

Then, HTML was created as a specific set of SGML tags used to define how web pages should be presented.

XML was created as a simplification of SGML.

XHTML was created to recast HTML as well-formed XML (requiring closing tags, for example, which hadn't been strictly necessary in SGML and HTML).

HTML 5 is the current version of HTML. It rejects the motivation behind XHTML and allows a looser specification of markup than the rules of XML would require.

Related