XML DOM | DocumentType Object

XML DOM - DocumentType Object


Hello folks! welcome back to a new section of our tutorial on XML DOM. In this tutorial post, we are going to be studying about the XML DOM DocumentType Object.

The XML DOM DocumentType object acts as an interface to the entities described for an XML document. Each of the documents contains a doctype attribute, that value can be a null or a DocumentType object.

DocumentType Object Methods

XML DOM DocumentType inherits methods from its parent Node and then implements the childNode interface.

DocumentType Object Attributes

The following table lists the attributes of the DocumentType object -

AttributeTypeDescription
nameDOMStringIt returns the name of the DTD which is written immediately next to the keyword !DOCTYPE.
entitiesNamedNodeMapIt returns a NamedNodeMap object containing the general entities, both external and internal, declared in the DTD.
notationsNamedNodeMapIt returns a NamedNodeMap containing the notations declared in the DTD.
internalSubsetDOMStringIt returns an internal subset as a string, or null if there is none.
publicIdDOMStringIt returns the public identifier of the external subset.
systemIdDOMStringIt returns the system identifier of the external subset. This may be an absolute URI or not.


Alright guys! This is where we are going to be rounding up for this tutorial post. In our next tutorial, we will be studying about XML DOM DocumentType name Attribute.

Feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Follow us on our various social media platforms to stay updated with our latest tutorials. You can also subscribe to our newsletter in order to get our tutorials delivered directly to your emails.

Thanks for reading and bye for now.