Class DocType

  • DocType represents an XML DocumentType node.

  • It provides methods to get and set various properties of the DocType, such as the element name, internal and external subset data, and its parent element.

  • The detach() method removes the DocType node from its parent.

DocType

A representation of an XML DocumentType node.

Methods

MethodReturn typeBrief description
detach()Content|nullDetaches the node from its parent Element node.
getElementName()StringGets the name of the root Element node specified in the DocType declaration.
getInternalSubset()StringGets the internal subset data for the DocumentType node.
getParentElement()Element|nullGets the node's parent Element node.
getPublicId()StringGets the public ID of the external subset data for the DocumentType node.
getSystemId()StringGets the system ID of the external subset data for the DocumentType node.
getValue()StringGets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document.
setElementName(name)DocTypeSets the name of the root Element node to specify in the DocType declaration.
setInternalSubset(data)DocTypeSets the internal subset data for the DocumentType node.
setPublicId(id)DocTypeSets the public ID of the external subset data for the DocumentType node.
setSystemId(id)DocTypeSets the system ID of the external subset data for the DocumentType node.

Detailed documentation

detach()

Detaches the node from its parent Element node. If the node does not have a parent, this method has no effect.

Return

Content|null — The detached node.


getElementName()

Gets the name of the root Element node specified in the DocType declaration.

Return

String — The name of the root Element node specified in the DocType declaration.


getInternalSubset()

Gets the internal subset data for the DocumentType node.

Return

String — The internal subset data.


getParentElement()

Gets the node's parent Element node. If the node does not have a parent, this method returns null.

Return

Element|null — The parent Element node.


getPublicId()

Gets the public ID of the external subset data for the DocumentType node.

Return

String — The public ID of the external subset data.


getSystemId()

Gets the system ID of the external subset data for the DocumentType node.

Return

String — The system ID of the external subset data.


getValue()

Gets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document.

Return

String — The text value of all nodes that are direct or indirect children of the node.


setElementName(name)

Sets the name of the root Element node to specify in the DocType declaration.

Parameters

NameTypeDescription
nameStringThe name of the root Element node to specify in the DocType declaration.

Return

DocType — The DocumentType node, for chaining.


setInternalSubset(data)

Sets the internal subset data for the DocumentType node.

Parameters

NameTypeDescription
dataStringThe internal subset data to set.

Return

DocType — The DocumentType node, for chaining.


setPublicId(id)

Sets the public ID of the external subset data for the DocumentType node.

Parameters

NameTypeDescription
idStringThe public ID of the external subset data to set.

Return

DocType — The DocumentType node, for chaining.


setSystemId(id)

Sets the system ID of the external subset data for the DocumentType node.

Parameters

NameTypeDescription
idStringThe system ID of the external subset data to set.

Return

DocType — The DocumentType node, for chaining.