|
A Document Type Declaration, or DOCTYPE, associates a particular SGML or XML document with a Document Type Definition (DTD). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax. The Standard Generalized Markup Language (SGML) is a metalanguage in which one can define markup languages for documents. ...
Jump to: navigation, search The Extensible Markup Language (XML) is a W3C-recommended general-purpose markup language for creating special-purpose markup languages. ...
A Document Type Definition (DTD for short) is a set of declarations that conform to a particular markup syntax and that describe a class, or type, of SGML or XML documents, in terms of constraints on the structure of those documents. ...
There is more than one usage of the word markup. ...
Despite its name, a Document Type Declaration is not suitable for deducing the type of the document, alhough apparently it was originally supposed to be. In new browsers for documents served as text/html, the DOCTYPE is used for doctype sniffing in order to choose a layout mode.
Example
A Document Type Declaration can be found in the source code of every Wikipedia page. For example, the first line of many Wikipedia pages reads as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> This Document Type Declaration includes by reference a DTD, whose public identifier is -//W3C//DTD XHTML 1.0 Transitional//EN and whose system identifier is http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd. An entity resolver may you either identifier for locating the referenced external entity. The root element is declared to be html. A public identifier is a document processing construct in SGML. It was subsequently incorporated into XML. In HTML and XML, a public identifier is meant to be universally unique within its application scope. ...
See also |