Document Interface

The Document interface is the topmost interface in the XML document tree. It contains nine defined methods, five additional methods derived from the various document attributes, and those methods and variables inherited from the Node interface. The Document interface performs four major functions, allowing developers to do the following:

  • Query for information about the document, such as its name, entities, and notations.

  • Query for information about the implementation, such as what version of the DOM core is supported.

  • Create documents, DocumentFragments, Elements, Nodes, Attributes, Comments, and so on.

  • Traverse the document tree.

The Document object always has Node type DOCUMENT_NODE. The following sections describe the methods ...

Get XML Development with Java™ 2 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.