!Doctype

End Tag: NA
Support Key: 2 | 3 | 3.2 | 4 | IE | M | N | O
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson [bloo@blooberry.com] =
Main Index | Element Tree | Element Index | HTML Support History


What is it?
The !Doctype declaration is a top-level element known as a Public Text Identifier. It should appear at the very beginning of an HTML document in order to identify the content of the document as conforming (theoretically) to a particular HTML DTD specification. Almost all popular browser parsers allow the omission of this declaration (probably because they are expecting HTML and they interpret only those elements and attributes which they can handle.) The quoted segment within a DOCTYPE declaration is called a Formal Public Identifier (FPI.) Every distinct DTD variation will have its own unique FPI string.
Syntax
Typical HTML DOCTYPE statement:
<!DOCTYPE   HTML   PUBLIC   "-// IETF// DTD   HTML// EN">
  (1) (2) (3) (4) (5) (6) (7)
Annotated syntax:
<!DOCTYPE   [Top Element  [Availability  "[Registration]// [Organization]// [Type  [Label]// [Language]">
  (1) (2) (3) (4) (5) (6) (7)
Explanation
General : A pair of forward slash characters ("//") is used as delimiters between keyword fields in the FPI declaration.
(1) : [Top Element] - Indicates the top level element type declared in the DTD; for HTML it is <html>.
(2) : [Availability] - field indicates whether the identifier is a publicly accessible object (PUBLIC) or a system resource (SYSTEM) such as a local file or URL. HTML DTDs are specified by PUBLIC identifiers.
(3) : [Registration] - Indicated by either a plus ("+") or minus ("-"). A plus symbol indicates that the organization name that follows is ISO-registered. A minus sign indicates the organization name is not registered. The IETF and W3C are not registered ISO organizations and thus use a "-".
(4) : [Organization] - This is the "OwnerID" - a unique label indicating the name of the entity or organization responsible for the creation and/or maintenance of the artifact (DTD, etc.) being referenced by the DOCTYPE. The IETF and W3C are the two originating organizations of the official HTML DTDs.
(5) : [Type] - This is the "Public Text Class" - the type of object being referenced. There are many different keywords possible here, but in the case of an HTML DTD, it is "DTD" - a Document Type Definition.
(6) : [Label] - This is the "Public Text Description" - a unique descriptive name for the public text being referenced. If the public text changes for any reason, a new Public Text Description should be created for it.
(7) : [Language] - This is the "Public Text Language"; the natural language encoding system used in the creation of the referenced object. It is written as an ISO 639 language code (uppercase, two letters.) HTML DTDs are usually (always?) written in English ("EN".)
[Note: If you are using Netscape and most of the above content is invisible, you are seeing an interesting and elusive Netscape rendering bug. A fix that works for me is to expand the browser window (if window is not already maximized and resolution permits) at least wide enough for the "Annotated Syntax" line to be visible on a single line. I have been trying to track down the reason for this behavior for a long time but it has been exceedingly hard to reproduce... this fix works on MY machine at least. Weird, no?]

Attributes
This element does not accept any attributes.
!DOCTYPE Examples
HTML 2.0
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0 Level 2//EN">
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Level 2//EN">
HTML 3.0
  <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN//">
HTML 3.2
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
HTML 4.0
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
Parent Model
NA
Content Model
<html>
Tips & Tricks Browser Peculiarities
Related Sites
Official References
http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1866.txt
RFC 1866: The HTML 2.0 specification (plain text)
http://www.w3.org/MarkUp/html-spec
The web version of the HTML 2.0 (RFC 1866) specification
http://www.w3.org/MarkUp/Wilbur/
The HTML 3.2 (Wilbur) recommendation
http://www.w3.org/TR/REC-html40/cover.html
The HTML 4.0 Specification Draft


Boring Copyright Stuff...