DOM - DocumentType Object



The DocumentType objects are the key to access the document's data and in the document, the doctype attribute can have either the null value or the DocumentType Object value. These DocumentType objects act as an interface to the entities described for an XML document.

Attributes

The following table lists the attributes of the DocumentType object −

Attribute Type Description
name DOMString It returns the name of the DTD which is written immediately next to the keyword !DOCTYPE.
entities NamedNodeMap It returns a NamedNodeMap object containing the general entities, both external and internal, declared in the DTD.
notations NamedNodeMap It returns a NamedNodeMap containing the notations declared in the DTD.
internalSubset DOMString It returns an internal subset as a string, or null if there is none. This has been removed. Refer specs.
publicId DOMString It returns the public identifier of the external subset.
systemId DOMString It returns the system identifier of the external subset. This may be an absolute URI or not.

Methods

DocumentType inherits methods from its parent, Node, and implements the ChildNode interface.

Advertisements