|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Document
public Document
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.
| Field Summary | |
|---|---|
Element |
documentElement
This is a convenience attribute that allows direct access to the child node that is the root element of the document. |
| Fields inherited from class Node |
|---|
childNodes, firstChild, lastChild, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, previousSibling |
| Method Summary | |
|---|---|
Comment |
createComment(String data)
Creates a Comment node given the specified string. |
Element |
createElement(String tagName)
Creates an element of the type specified. |
Text |
createTextNode(String data)
Creates a Text node given the specified string. |
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. |
| Methods inherited from class Node |
|---|
appendChild, hasChildNodes, insertBefore, removeChild, replaceChild |
| Field Detail |
|---|
final Element documentElement
| Method Detail |
|---|
Comment createComment(String data)
data - The data for the node.
Element getElementById(String elementId)
elementId - The unique id value for an element.
NodeList getElementsByTagName(String tagName)
tagName - The name of the tag to match on. The special value "*" matches all tags.
Text createTextNode(String data)
data - The data for the node.
Element createElement(String tagName)
tagName - The name of the element type to instantiate. For XML, this is case-sensitive. For HTML, the tagName parameter may be provided in any case, but it must be mapped to the canonical uppercase form by the DOM implementation.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||