Document types

Information about a document (beyond the actual content hierarchies and text) is encapsulated in an object of type DocumentType, which is returned by the getDoctype method.

This interface contains the following methods:

String        getName();
NamedNodeList getEntities();
NamedNodeList getNotations();

The getName method returns the name of the document, which is the word appearing after the DOCTYPE keyword, and is also the name of the root element.

The getEntities and getNotations methods return an object that contains a list of nodes that represent general entities (either internal or external) or notations declared in the document and DTD.

Note that DOM Level 2 adds methods for accessing the declarations that create the document ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.