org.w3c.dom
Interface Document

All Superinterfaces:
Node
public interface Document
extends Node

The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.

Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the Document interface also contains the factory methods needed to create these objects. The Node objects created have a ownerDocument attribute which associates them with the Document within whose context they were created.

See also the Document Object Model (DOM) Level 2 Core Specification.

 

Field Summary

 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 

 

Method Summary

 Attr createAttribute(String name)
    Creates an Attr of the given name.
 Attr createAttributeNS(String namespaceURI, String qualifiedName)
    Creates an attribute of the given qualified name and namespace URI.
 CDATASection createCDATASection(String data)
    Creates a CDATASection node whose value is the specified string.
 Comment createComment(String data)
    Creates a Comment node given the specified string.
 DocumentFragment createDocumentFragment()
    Creates an empty DocumentFragment object.
 Element createElement(String tagName)
    Creates an element of the type specified.
 Element createElementNS(String namespaceURI, String qualifiedName)
    Creates an element of the given qualified name and namespace URI.
 EntityReference createEntityReference(String name)
    Creates an EntityReference object.
 ProcessingInstruction createProcessingInstruction(String target, String data)
    Creates a ProcessingInstruction node given the specified name and data strings.
 Text createTextNode(String data)
    Creates a Text node given the specified string.
 DocumentType getDoctype()
    The Document Type Declaration (see DocumentType) associated with this document.
 Element getDocumentElement()
    This is a convenience attribute that allows direct access to the child node that is the root element of the document.
 Element getElementById(String elementId)
    Returns the Element whose ID is given by elementId.
 NodeList getElementsByTagName(String tagname)
    Returns a NodeList of all the Elements with a given tag name in the order in which they are encountered in a preorder traversal of the Document tree.
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
    Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.
 DOMImplementation getImplementation()
    The DOMImplementation object that handles this document.
 Node