Class DocType

文档类型

XML DocumentType 节点的表示形式。

方法

方法返回类型简介
detach()Content|null将节点从其父级 Element 节点分离。
getElementName()String获取 DocType 声明中指定的根 Element 节点的名称。
getInternalSubset()String获取 DocumentType 节点的内部子集数据。
getParentElement()Element|null获取节点的父 Element 节点。
getPublicId()String获取 DocumentType 节点的外部子集数据的公开 ID。
getSystemId()String获取 DocumentType 节点的外部子集数据的系统 ID。
getValue()String按节点在文档中出现的顺序获取该节点的所有直属或非直属子节点的文本值。
setElementName(name)DocType设置根 Element 节点的名称,以便在 DocType 声明中指定。
setInternalSubset(data)DocTypeDocumentType 节点设置内部子集数据。
setPublicId(id)DocTypeDocumentType 节点设置外部子集数据的公开 ID。
setSystemId(id)DocTypeDocumentType 节点设置外部子集数据的系统 ID。

详细文档

detach()

将节点从其父级 Element 节点分离。如果节点没有父节点,此方法不起作用。

返回

Content|null - 分离的节点。


getElementName()

获取 DocType 声明中指定的根 Element 节点的名称。

返回

String - DocType 声明中指定的根 Element 节点的名称。


getInternalSubset()

获取 DocumentType 节点的内部子集数据。

返回

String - 内部子集数据。


getParentElement()

获取节点的父 Element 节点。如果节点没有父级,此方法会返回 null

返回

Element|null - 父级 Element 节点。


getPublicId()

获取 DocumentType 节点的外部子集数据的公开 ID。

返回

String - 外部子集数据的公开 ID。


getSystemId()

获取 DocumentType 节点的外部子集数据的系统 ID。

返回

String - 外部子集数据的系统 ID。


getValue()

按节点在文档中出现的顺序获取该节点的所有直属或非直属子节点的文本值。

返回

String - 相应节点的所有直接或间接子节点的文本值。


setElementName(name)

设置根 Element 节点的名称,以便在 DocType 声明中指定。

参数

名称类型说明
nameString要在 DocType 声明中指定的根 Element 节点的名称。

返回

DocType - DocumentType 节点,用于链式调用。


setInternalSubset(data)

DocumentType 节点设置内部子集数据。

参数

名称类型说明
dataString要设置的内部子集数据。

返回

DocType - DocumentType 节点,用于链式调用。


setPublicId(id)

DocumentType 节点设置外部子集数据的公开 ID。

参数

名称类型说明
idString要设置的外部子集数据的公开 ID。

返回

DocType - DocumentType 节点,用于链式调用。


setSystemId(id)

DocumentType 节点设置外部子集数据的系统 ID。

参数

名称类型说明
idString要设置的外部子集数据的系统 ID。

返回

DocType - DocumentType 节点,用于链式调用。