Polyglot markup Polyglot markup In computing, a polyglot markup is a document or script written in a valid form of multiple markup languages, which performs the same output, independent of the markup's parser, layout engine, or interpreter. In general, the "polyglot markup" is a common subset of two or more languages, that can be used as a robust or simplified profile. Polyglot HTML is HTML that has been written to conform to both the HTML and XHTML specifications. A polyglot document can therefore be parsed as either HTML (which is SGML-compatible) or XML, and will produce the same DOM structure either way.
Polyglot markup For example, in order for an HTML5 document to meet these criteria, the two requirements are that it must have an HTML5 doctype, and be written in well-formed XHTML. The same document can then be served as either HTML or XHTML, depending on browser support and MIME type. As expressed by the "html-polyglot recommendation", to write a polyglot HTML5 document, the following key points should be observed: The most basic possible polyglot markup document would therefore look like this: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> </html> In a polyglot markup document non-void elements (such as codice_1, codice_2, codice_3) cannot be