DocumentType : Node
Return to: HTML DOM Level 2 index

Represents the <!DOCTYPE> of a document.

Platform Support

IE Mozilla Netscape Opera Safari Chrome
6.0+ 1.0+ 6.0+ 7.0+ no no

Constructors

Constructor Action IE Mozilla Netscape Opera Safari Chrome
DocumentType Constructor() : DocumentType
Represents the <!DOCTYPE> of a document.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ no no

DocumentType() : DocumentType

Represents the <!DOCTYPE> of a document.

Returns
DocumentType

Visibility
internal

Properties

Property Action IE Mozilla Netscape Opera Safari Chrome
entities : NamedNodeMap
List of entities defined in the DTD.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ no no
Remarks
List of all of the general entities defined within this DTD. This includes both internal and external entities. Any duplicates are discarded, with the first occurance of a named entity being preserved. Every key value within this property uses the Entity interface.
Availability

HTML DOM Level 2|W3C

Contents of the DTD subset
Show Details 6.0+ 1.0+ 6.0+ 7.0+ no no
Remarks

This value contains the string contained between the "[" and "]" characters. Not all DocumentType objects will contain a value in this property, which can rely on an external file for defining entities.

Availability

HTML DOM Level 2|W3C

name : String
Name of the DTD.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ no no

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/attributes.html

Remarks
Name of the DTD, which is represented in XML documents as the name immediately after the keyword.
Availability

HTML DOM Level 2|W3C

notations : NamedNodeMap
List of notations defined in this DTD
Show Details 6.0+ 1.0+ 6.0+ 7.0+ no no
Remarks
List of all the notations defined in this DTD. Like entities, any duplicates are discarded, keeping only the first occurance of any duplicated key.
Availability

HTML DOM Level 2|W3C

publicId : String
The public identifier of the external subset
Show Details 6.0+ 1.0+ 6.0+ 7.0+ no no
Remarks
Public identifier of the document type definition. This is usually a common identifier used to represent a kind of content. For instance, the publicId value for an XHTML document could be "-//W3C//DTD XHTML 1.0 Transitional//EN".

Availability

HTML DOM Level 2|W3C

systemId : String
The system identifier of the external subset
Show Details 6.0+ 1.0+ 6.0+ 7.0+ no no
Remarks
This is the system identifier, or filename, of the document type definition itself. This is usually a path to a file on disk or a URI pointing at the DTD.
Availability

HTML DOM Level 2|W3C

Remarks

This represents the doctype for a Document. If a document has a doctype, it will be a reference to an instantiation of this interface. This object represents all the information stored in the ]]> section of a source document.

Throughout the rest of the documentation in this object, the following sample DTD will be used to illustrate how the various properties work.

]> ]]>

References

Document|Entity|Notation

Availability

HTML DOM Level 2|W3C

text_javascript aptana_docs