Dom 简明教程

DOM - DocumentType Object

DocumentType 对象是访问文档数据的关键,在文档中,doctype 属性可以具有空值或 DocumentType 对象值。这些 DocumentType 对象充当 XML 文档描述的实体的接口。

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

下表列出了 DocumentType 对象的属性 -

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 从其父级 Node 继承方法并实现 ChildNode 接口。

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