The <?xml version="1.0"?> Declaration for HTML
The XML declaration is one of the declaration tags in HTML and is the very first line of code in an HTML document. The <?xml?> declaration at the top of an HTML document indicates that the document is in XML or polyglot format. It is an SGML declaration that determines:
- what characters can appear in the document,
- how those characters are to be interpreted as text and delimited elements, and
- that there are no external XML declarations, since there is no DTD in HTML 5
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
The XML declaration may be ignored when the document is being parsed as HTML, but is relevant when:
- the document is being parsed as xHTML, the XHTML-compatible serialization of HTML based on XML
- the document is being parsed as pure XML