This section describes syntax formats of the DOCTYPE statement, which is used to declare that this XML document has been linked to DTD document type with the specified root element name.
DOCTYPE is a DTD statement included in an XML file to declare that
this XML document has been linked to DTD document type and to specify the name of the root element of this XML document.
Valid syntax formats for DOCTYPE statement are:
<!DOCTYPE root_element [
internal_DTD_statements
]>
<!DOCTYPE root_element SYSTEM "DTD_location">
<!DOCTYPE root_element SYSTEM "DTD_location" [
internal_DTD_statements
]>
<!DOCTYPE root_element PUBLIC "DTD_name" "DTD_location">
<!DOCTYPE root_element PUBLIC "DTD_name" "DTD_location"
internal_DTD_statements
]>
General rules about the DOCTYPE statement:
It must appear right after the "xml" processing instruction and before the root element.
"root_element" names the root element of the XML document.
Key word "SYSTEM" indicates that the external DTD file specified as "DTD_location" is private.
Key word "PUBLIC" indicates that the external DTD file specified as "DTD_location" is public.
"DTD_location" is a URL of the external DTD file.
"DTD_name" is a publicly recognized name of a specific DTD file, like
"-//W3C//DTD HTML 4.0 Transitional//EN".
If an internal DTD statement is conflicting with an external statement,
the internal statement takes precedence.