Definition of HTML "polyglot"

Polyglot HTML documents can be processed by either HTML or XML parsers

A polyglot HTML document is an HTML document that has been coded in such a way that it can be successfully parsed in any of three ways:

  1. as an HTML serialization of HTML, such as by web browsers and other software that process HTML documents from that serialization format
  2. as an XML serialization of HTML (xHTML), such as by web browsers and other software that process HTML documents from that serialization format
  3. as pure XML, such as by aggregators, XSLT and other software that process documents as XML

A significant advantage of starting to code HTML documents using polyglot HTML syntax is that, by definition it is a common generic subset of the other possible syntaxes, and so there are fewer rules for newcomers beginning to code HTML to learn. Then if at some point later you find a need for a feature of one of the more specific HTML syntax alternatives for some task you are trying to accomplish, you will be able to determine which of the two possible HTML syntax options should suit your needs.