Prolog
The prolog includes information that applies to the whole document such as the XML version, the character encoding and the document structure.
- The XML version must be the first line in the document and no other content or white space can precede it.
- The encoding declaration must appear immediately after the version information in the XML declaration.
- The DOCTYPE declaration allows to identify the root element of the document and the related document type definition (DTD) by referencing an external file, through direct declarations, or both. A DOCTYPE declaration can contain:
- The name of the root element. This is required if the DOCTYPE declaration is used.
- A subset of DTD direct declarations listed between brackets (
[ ]
). Each declaration is an ENTITY definition with a prefix (string) of a namespace that refers to an external vocabulary content. The terms (or elements) of such external vocabulary is intended to be reused in the current vocabulary (acts like a C/C++ #include statement).