This section defines the term document, and provides additional details related to the definition of that term. It is divided into the following parts:
The term document is used in this reference to mean an instance of the HTML language.
The HTML language is the language described in this reference; it is an abstract language that applications can potentially represent in memory in any number of possible ways, and that can be transmitted using any number of possible concrete syntaxes.
This reference describes two particular concrete syntaxes for the HTML language: One syntax, which is referred to throughout this reference as the HTML syntax, and another syntax, which is referred to throughout this reference as the XML syntax. Web browsers typically implement two separate parsers for processing documents: an HTML parser which is invoked when processing documents in the HTML syntax, and an XML parser which is invoked when processing documents in the XML syntax.
The HTML syntax is the syntax described in the HTML syntax section of this reference.
The XML syntax is defined by rules in the XML specification [XML] and in the Namespaces in XML 1.0 specification [XMLNS]; any syntax-level requirements for documents in the XML syntax described in this reference are intended to be the same as those defined in the XML specification.
Documents that have an
declaration and that are served with an XML MIME type
match the descriptions in this
reference for characteristics of
documents in the XML syntax.
A conformant document in the HTML syntax must consist of the following parts, in the following order:
Documents in the XML syntax must not make use of any features of the HTML syntax that do not follow XML well-formedness constraints (for example, documents in the XML syntax must not use unquoted attribute value syntax and must not omit tags).