| Package | Description | 
|---|---|
| org.w3c.dom | Provides the interfaces for the Document Object Model (DOM). | 
| org.w3c.dom.events | |
| org.w3c.dom.html | |
| org.w3c.dom.ls | |
| org.w3c.dom.ranges | 
      Document Object Model Level 2 Traversal and Range is a 
      platform and language-neutral interfaces that allow programs 
      and scripts to dynamically traverse and identify a range of
      content in a document. | 
| org.w3c.dom.stylesheets | |
| org.w3c.dom.traversal | 
| Modifier and Type | Interface and Description | 
|---|---|
| interface  | AttrThe  Attrinterface represents an attribute in anElementobject. | 
| interface  | CDATASectionCDATA sections are used to escape blocks of text containing characters that
 would otherwise be regarded as markup. | 
| interface  | CharacterDataThe  CharacterDatainterface extends Node with a set of
 attributes and methods for accessing character data in the DOM. | 
| interface  | CommentThis interface inherits from  CharacterDataand represents the
 content of a comment, i.e., all the characters between the starting '<!--' and ending '-->'. | 
| interface  | DocumentThe  Documentinterface represents the entire HTML or XML
 document. | 
| interface  | DocumentFragmentDocumentFragmentis a "lightweight" or "minimal"Documentobject. | 
| interface  | DocumentTypeEach  Documenthas adoctypeattribute whose value
 is eithernullor aDocumentTypeobject. | 
| interface  | ElementThe  Elementinterface represents an element in an HTML or XML
 document. | 
| interface  | EntityThis interface represents a known entity, either parsed or unparsed, in an
 XML document. | 
| interface  | EntityReferenceEntityReferencenodes may be used to represent an entity
 reference in the tree. | 
| interface  | NotationThis interface represents a notation declared in the DTD. | 
| interface  | ProcessingInstructionThe  ProcessingInstructioninterface represents a "processing
 instruction", used in XML as a way to keep processor-specific information
 in the text of the document. | 
| interface  | TextThe  Textinterface inherits fromCharacterDataand represents the textual content (termed character data in XML) of anElementorAttr. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | Document. adoptNode(Node source)Attempts to adopt a node from another document to this document. | 
| Node | Node. appendChild(Node newChild)Adds the node  newChildto the end of the list of children
 of this node. | 
| Node | Node. cloneNode(boolean deep)Returns a duplicate of this node, i.e., serves as a generic copy
 constructor for nodes. | 
| Node | Node. getFirstChild()The first child of this node. | 
| Node | Node. getLastChild()The last child of this node. | 
| Node | NamedNodeMap. getNamedItem(String name)Retrieves a node specified by name. | 
| Node | NamedNodeMap. getNamedItemNS(String namespaceURI,
              String localName)Retrieves a node specified by local name and namespace URI. | 
| Node | Node. getNextSibling()The node immediately following this node. | 
| Node | Node. getParentNode()The parent of this node. | 
| Node | Node. getPreviousSibling()The node immediately preceding this node. | 
| Node | DOMLocator. getRelatedNode()The node this locator is pointing to, or  nullif no node
 is available. | 
| Node | Document. importNode(Node importedNode,
          boolean deep)Imports a node from another document to this document, without altering
 or removing the source node from the original document; this method
 creates a new copy of the source node. | 
| Node | Node. insertBefore(Node newChild,
            Node refChild)Inserts the node  newChildbefore the existing child noderefChild. | 
| Node | NodeList. item(int index)Returns the  indexth item in the collection. | 
| Node | NamedNodeMap. item(int index)Returns the  indexth item in the map. | 
| Node | Node. removeChild(Node oldChild)Removes the child node indicated by  oldChildfrom the list
 of children, and returns it. | 
| Node | NamedNodeMap. removeNamedItem(String name)Removes a node specified by name. | 
| Node | NamedNodeMap. removeNamedItemNS(String namespaceURI,
                 String localName)Removes a node specified by local name and namespace URI. | 
| Node | Document. renameNode(Node n,
          String namespaceURI,
          String qualifiedName)Rename an existing node of type  ELEMENT_NODEorATTRIBUTE_NODE. | 
| Node | Node. replaceChild(Node newChild,
            Node oldChild)Replaces the child node  oldChildwithnewChildin the list of children, and returns theoldChildnode. | 
| Node | NamedNodeMap. setNamedItem(Node arg)Adds a node using its  nodeNameattribute. | 
| Node | NamedNodeMap. setNamedItemNS(Node arg)Adds a node using its  namespaceURIandlocalName. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | Document. adoptNode(Node source)Attempts to adopt a node from another document to this document. | 
| Node | Node. appendChild(Node newChild)Adds the node  newChildto the end of the list of children
 of this node. | 
| short | Node. compareDocumentPosition(Node other)Compares the reference node, i.e. | 
| void | UserDataHandler. handle(short operation,
      String key,
      Object data,
      Node src,
      Node dst)This method is called whenever the node for which this handler is
 registered is imported or cloned. | 
| Node | Document. importNode(Node importedNode,
          boolean deep)Imports a node from another document to this document, without altering
 or removing the source node from the original document; this method
 creates a new copy of the source node. | 
| Node | Node. insertBefore(Node newChild,
            Node refChild)Inserts the node  newChildbefore the existing child noderefChild. | 
| boolean | Node. isEqualNode(Node arg)Tests whether two nodes are equal. | 
| boolean | Node. isSameNode(Node other)Returns whether this node is the same node as the given one. | 
| Node | Node. removeChild(Node oldChild)Removes the child node indicated by  oldChildfrom the list
 of children, and returns it. | 
| Node | Document. renameNode(Node n,
          String namespaceURI,
          String qualifiedName)Rename an existing node of type  ELEMENT_NODEorATTRIBUTE_NODE. | 
| Node | Node. replaceChild(Node newChild,
            Node oldChild)Replaces the child node  oldChildwithnewChildin the list of children, and returns theoldChildnode. | 
| Node | NamedNodeMap. setNamedItem(Node arg)Adds a node using its  nodeNameattribute. | 
| Node | NamedNodeMap. setNamedItemNS(Node arg)Adds a node using its  namespaceURIandlocalName. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | MutationEvent. getRelatedNode()relatedNodeis used to identify a secondary node related
 to a mutation event. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | MutationEvent. initMutationEvent(String typeArg,
                 boolean canBubbleArg,
                 boolean cancelableArg,
                 Node relatedNodeArg,
                 String prevValueArg,
                 String newValueArg,
                 String attrNameArg,
                 short attrChangeArg)The  initMutationEventmethod is used to initialize the
 value of aMutationEventcreated through theDocumentEventinterface. | 
| Modifier and Type | Interface and Description | 
|---|---|
| interface  | HTMLAnchorElementThe anchor element. | 
| interface  | HTMLAppletElementAn embedded Java applet. | 
| interface  | HTMLAreaElementClient-side image map area definition. | 
| interface  | HTMLBaseElementDocument base URI. | 
| interface  | HTMLBaseFontElementBase font. | 
| interface  | HTMLBodyElementThe HTML document body. | 
| interface  | HTMLBRElementForce a line break. | 
| interface  | HTMLButtonElementPush button. | 
| interface  | HTMLDirectoryElementDirectory list. | 
| interface  | HTMLDivElementGeneric block container. | 
| interface  | HTMLDListElementDefinition list. | 
| interface  | HTMLDocumentAn  HTMLDocumentis the root of the HTML hierarchy and holds
 the entire content. | 
| interface  | HTMLElementAll HTML element interfaces derive from this class. | 
| interface  | HTMLFieldSetElementOrganizes form controls into logical groups. | 
| interface  | HTMLFontElementLocal change to font. | 
| interface  | HTMLFormElementThe  FORMelement encompasses behavior similar to a collection
 and an element. | 
| interface  | HTMLFrameElementCreate a frame. | 
| interface  | HTMLFrameSetElementCreate a grid of frames. | 
| interface  | HTMLHeadElementDocument head information. | 
| interface  | HTMLHeadingElementFor the  H1toH6elements. | 
| interface  | HTMLHRElementCreate a horizontal rule. | 
| interface  | HTMLHtmlElementRoot of an HTML document. | 
| interface  | HTMLIFrameElementInline subwindows. | 
| interface  | HTMLImageElementEmbedded image. | 
| interface  | HTMLInputElementForm control. | 
| interface  | HTMLIsIndexElementThis element is used for single-line text input. | 
| interface  | HTMLLabelElementForm field label text. | 
| interface  | HTMLLegendElementProvides a caption for a  FIELDSETgrouping. | 
| interface  | HTMLLIElementList item. | 
| interface  | HTMLLinkElementThe  LINKelement specifies a link to an external resource,
 and defines this document's relationship to that resource (or vice versa). | 
| interface  | HTMLMapElementClient-side image map. | 
| interface  | HTMLMenuElementMenu list. | 
| interface  | HTMLMetaElementThis contains generic meta-information about the document. | 
| interface  | HTMLModElementNotice of modification to part of a document. | 
| interface  | HTMLObjectElementGeneric embedded object. | 
| interface  | HTMLOListElementOrdered list. | 
| interface  | HTMLOptGroupElementGroup options together in logical subdivisions. | 
| interface  | HTMLOptionElementA selectable choice. | 
| interface  | HTMLParagraphElementParagraphs. | 
| interface  | HTMLParamElementParameters fed to the  OBJECTelement. | 
| interface  | HTMLPreElementPreformatted text. | 
| interface  | HTMLQuoteElementFor the  QandBLOCKQUOTEelements. | 
| interface  | HTMLScriptElementScript statements. | 
| interface  | HTMLSelectElementThe select element allows the selection of an option. | 
| interface  | HTMLStyleElementStyle information. | 
| interface  | HTMLTableCaptionElementTable caption See the  CAPTION element definition in HTML 4.0. | 
| interface  | HTMLTableCellElementThe object used to represent the  THandTDelements. | 
| interface  | HTMLTableColElementRegroups the  COLandCOLGROUPelements. | 
| interface  | HTMLTableElementThe create* and delete* methods on the table allow authors to construct
 and modify tables. | 
| interface  | HTMLTableRowElementA row in a table. | 
| interface  | HTMLTableSectionElementThe  THEAD,TFOOT, andTBODYelements. | 
| interface  | HTMLTextAreaElementMulti-line text field. | 
| interface  | HTMLTitleElementThe document title. | 
| interface  | HTMLUListElementUnordered list. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | HTMLCollection. item(int index)This method retrieves a node specified by ordinal index. | 
| Node | HTMLCollection. namedItem(String name)This method retrieves a  Nodeusing a name. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | LSParser. parseWithContext(LSInput input,
                Node contextArg,
                short action)Parse an XML fragment from a resource identified by a
  LSInputand insert the content into an existing document
 at the position specified with thecontextandactionarguments. | 
| Modifier and Type | Method and Description | 
|---|---|
| short | LSParserFilter. acceptNode(Node nodeArg)This method will be called by the parser at the completion of the
 parsing of each node. | 
| Node | LSParser. parseWithContext(LSInput input,
                Node contextArg,
                short action)Parse an XML fragment from a resource identified by a
  LSInputand insert the content into an existing document
 at the position specified with thecontextandactionarguments. | 
| boolean | LSSerializer. write(Node nodeArg,
     LSOutput destination)Serialize the specified node as described above in the general
 description of the  LSSerializerinterface. | 
| String | LSSerializer. writeToString(Node nodeArg)Serialize the specified node as described above in the general
 description of the  LSSerializerinterface. | 
| boolean | LSSerializer. writeToURI(Node nodeArg,
          String uri)A convenience method that acts as if  LSSerializer.writewas called with aLSOutputwith no encoding specified
 andLSOutput.systemIdset to theuriargument. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | Range. getCommonAncestorContainer()The deepest common ancestor container of the Range's two
 boundary-points. | 
| Node | Range. getEndContainer()Node within which the Range ends | 
| Node | Range. getStartContainer()Node within which the Range begins | 
| Modifier and Type | Method and Description | 
|---|---|
| void | Range. insertNode(Node newNode)Inserts a node into the Document or DocumentFragment at the start of
 the Range. | 
| void | Range. selectNode(Node refNode)Select a node and its contents | 
| void | Range. selectNodeContents(Node refNode)Select the contents within a node | 
| void | Range. setEnd(Node refNode,
      int offset)Sets the attributes describing the end of a Range. | 
| void | Range. setEndAfter(Node refNode)Sets the end of a Range to be after a node | 
| void | Range. setEndBefore(Node refNode)Sets the end position to be before a node. | 
| void | Range. setStart(Node refNode,
        int offset)Sets the attributes describing the start of the Range. | 
| void | Range. setStartAfter(Node refNode)Sets the start position to be after a node | 
| void | Range. setStartBefore(Node refNode)Sets the start position to be before a node | 
| void | Range. surroundContents(Node newParent)Reparents the contents of the Range to the given node and inserts the
 node at the position of the start of the Range. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | StyleSheet. getOwnerNode()The node that associates this style sheet with the document. | 
| Modifier and Type | Method and Description | 
|---|---|
| Node | TreeWalker. firstChild()Moves the  TreeWalkerto the first visible child of the
 current node, and returns the new node. | 
| Node | TreeWalker. getCurrentNode()The node at which the  TreeWalkeris currently positioned. | 
| Node | TreeWalker. getRoot()The  rootnode of theTreeWalker, as specified
 when it was created. | 
| Node | NodeIterator. getRoot()The root node of the  NodeIterator, as specified when it
 was created. | 
| Node | TreeWalker. lastChild()Moves the  TreeWalkerto the last visible child of the
 current node, and returns the new node. | 
| Node | TreeWalker. nextNode()Moves the  TreeWalkerto the next visible node in document
 order relative to the current node, and returns the new node. | 
| Node | NodeIterator. nextNode()Returns the next node in the set and advances the position of the
  NodeIteratorin the set. | 
| Node | TreeWalker. nextSibling()Moves the  TreeWalkerto the next sibling of the current
 node, and returns the new node. | 
| Node | TreeWalker. parentNode()Moves to and returns the closest visible ancestor node of the current
 node. | 
| Node | TreeWalker. previousNode()Moves the  TreeWalkerto the previous visible node in
 document order relative to the current node, and returns the new
 node. | 
| Node | NodeIterator. previousNode()Returns the previous node in the set and moves the position of the
  NodeIteratorbackwards in the set. | 
| Node | TreeWalker. previousSibling()Moves the  TreeWalkerto the previous sibling of the
 current node, and returns the new node. | 
| Modifier and Type | Method and Description | 
|---|---|
| short | NodeFilter. acceptNode(Node n)Test whether a specified node is visible in the logical view of a
  TreeWalkerorNodeIterator. | 
| NodeIterator | DocumentTraversal. createNodeIterator(Node root,
                  int whatToShow,
                  NodeFilter filter,
                  boolean entityReferenceExpansion)Create a new  NodeIteratorover the subtree rooted at the
 specified node. | 
| TreeWalker | DocumentTraversal. createTreeWalker(Node root,
                int whatToShow,
                NodeFilter filter,
                boolean entityReferenceExpansion)Create a new  TreeWalkerover the subtree rooted at the
 specified node. | 
| void | TreeWalker. setCurrentNode(Node currentNode)The node at which the  TreeWalkeris currently positioned. | 
 Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
 Copyright © 2005, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.