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 versionmust 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
DOCTYPEdeclaration allows you 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. ADOCTYPEdeclaration can contain:- The name of the root element. This is mandatory when using the
DOCTYPEdeclaration. - A subset of DTD direct declarations listed between brackets (
[ ]). Each declaration is anENTITYdefinition with the prefix string of a namespace that refers to an external vocabulary content. This is to reuse the terms or elements of the external vocabulary in the current vocabulary (acts like a C/C++#includestatement).
- The name of the root element. This is mandatory when using the
Prolog Declaration Example




