The <?xml version="1.0"?> Declaration for HTML
The XML declaration is one of the declaration tags in HTML and is the first line of code in an HTML document. It is an SGML declaration that defines:
- 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