All Packages Class Hierarchy This Package Previous Next Index
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.
Attr
of the given name.
CDATASection
node whose value is the specified
string.
Comment
node given the specified string.
DocumentFragment
object.
ProcessingInstruction
node given the specified
name and data strings.
Text
node given the specified string.
DocumentType
) associated
with this document.
NodeList
of all the Element
s with a
given tag name in the order in which they would be encountered in a
preorder traversal of the Document
tree.
DOMImplementation
object that handles this document.
public abstract DocumentType getDoctype()
DocumentType
) associated
with this document. For HTML documents as well as XML documents without
a document type declaration this returns null
. The DOM Level
1 does not support editing the Document Type Declaration, therefore
docType
cannot be altered in any way.
public abstract DOMImplementation getImplementation()
DOMImplementation
object that handles this document. A
DOM application may use objects from multiple implementations.
public abstract Element getDocumentElement()
public abstract Element createElement(String tagName) throws DOMException
tagName
parameter may
be provided in any case, but it must be mapped to the canonical
uppercase form by the DOM implementation.
Element
object.
public abstract DocumentFragment createDocumentFragment()
DocumentFragment
object.
DocumentFragment
.
public abstract Text createTextNode(String data)
Text
node given the specified string.
Text
object.
public abstract Comment createComment(String data)
Comment
node given the specified string.
Comment
object.
public abstract CDATASection createCDATASection(String data) throws DOMException
CDATASection
node whose value is the specified
string.
CDATASection
contents.
CDATASection
object.
public abstract ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException
ProcessingInstruction
node given the specified
name and data strings.
ProcessingInstruction
object.
public abstract Attr createAttribute(String name) throws DOMException
Attr
of the given name. Note that the
Attr
instance can then be set on an Element
using the setAttribute
method.
Attr
object.
public abstract EntityReference createEntityReference(String name) throws DOMException
EntityReference
object.
public abstract NodeList getElementsByTagName(String tagname)
NodeList
of all the Element
s with a
given tag name in the order in which they would be encountered in a
preorder traversal of the Document
tree.
NodeList
object containing all the matched
Element
s.
All Packages Class Hierarchy This Package Previous Next Index