Example usage for Java org.w3c.dom Document fields, constructors, methods, implement or subclass
The text is from its open source code.
Node | adoptNode(Node source) Attempts to adopt a node from another document to this document. |
Node | appendChild(Node newChild) Adds the node newChild to the end of the list of children of this node. |
Node | cloneNode(boolean deep) Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. |
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. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
NamedNodeMap | getAttributes() A NamedNodeMap containing the attributes of this node (if it is an Element ) or null otherwise. |
String | getBaseURI() The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI. |
NodeList | getChildNodes() A NodeList that contains all children of this node. |
Class> | getClass() Returns the runtime class of this Object . |
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 document element of the document. |
String | getDocumentURI() The location of the document or null if undefined or if the Document was created using DOMImplementation.createDocument . |
DOMConfiguration | getDomConfig() The configuration used when Document.normalizeDocument() is invoked. |
Element | getElementById(String elementId) Returns the Element that has an ID attribute with the given value. |
NodeList | getElementsByTagName(String tagname) Returns a NodeList of all the Elements in document order with a given tag name and are contained in the document. |
NodeList | getElementsByTagNameNS(String namespaceURI, String localName) Returns a NodeList of all the Elements with a given local name and namespace URI in document order. |
Object | getFeature(String feature, String version) This method returns a specialized object which implements the specialized APIs of the specified feature and version, as specified in . |
Node | getFirstChild() The first child of this node. |
DOMImplementation | getImplementation() The DOMImplementation object that handles this document. |
String | getInputEncoding() An attribute specifying the encoding used for this document at the time of the parsing. |
Node | getLastChild() The last child of this node. |
String | getNamespaceURI() The namespace URI of this node, or null if it is unspecified (see ). |
short | getNodeType() A code representing the type of the underlying object, as defined above. |
String | getNodeValue() The value of this node, depending on its type; see the table above. |
Document | getOwnerDocument() The Document object associated with this node. |
Node | getParentNode() The parent of this node. |
String | getPrefix() The namespace prefix of this node, or null if it is unspecified. |
boolean | getStrictErrorChecking() An attribute specifying whether error checking is enforced or not. |
String | getTextContent() This attribute returns the text content of this node and its descendants. |
Object | getUserData(String key) Retrieves the object associated to a key on a this node. |
String | getXmlEncoding() An attribute specifying, as part of the XML declaration, the encoding of this document. |
boolean | getXmlStandalone() An attribute specifying, as part of the XML declaration, whether this document is standalone. |
String | getXmlVersion() An attribute specifying, as part of the XML declaration, the version number of this document. |
boolean | hasChildNodes() Returns whether this node has any children. |
Node | 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 | insertBefore(Node newChild, Node refChild) Inserts the node newChild before the existing child node refChild . |
boolean | isEqualNode(Node arg) Tests whether two nodes are equal. |
String | lookupNamespaceURI(String prefix) Look up the namespace URI associated to the given prefix, starting from this node. |
String | lookupPrefix(String namespaceURI) Look up the prefix associated to the given namespace URI, starting from this node. |
void | normalize() Puts all Text nodes in the full depth of the sub-tree underneath this Node , including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. |
void | normalizeDocument() This method acts as if the document was going through a save and load cycle, putting the document in a "normal" form. |
Node | removeChild(Node oldChild) Removes the child node indicated by oldChild from the list of children, and returns it. |
Node | renameNode(Node n, String namespaceURI, String qualifiedName) Rename an existing node of type ELEMENT_NODE or ATTRIBUTE_NODE . |
Node | replaceChild(Node newChild, Node oldChild) Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. |
void | setDocumentURI(String documentURI) The location of the document or null if undefined or if the Document was created using DOMImplementation.createDocument . |
void | setNodeValue(String nodeValue) The value of this node, depending on its type; see the table above. |
void | setStrictErrorChecking(boolean strictErrorChecking) An attribute specifying whether error checking is enforced or not. |
Object | setUserData(String key, Object data, UserDataHandler handler) Associate an object to a key on this node. |
void | setXmlStandalone(boolean xmlStandalone) An attribute specifying, as part of the XML declaration, whether this document is standalone. |
void | setXmlVersion(String xmlVersion) An attribute specifying, as part of the XML declaration, the version number of this document. |
String | toString() Returns a string representation of the object. |