Moves node from another document, and returns it. Throws "NotSupportedError" DOMException if node is a document, or a "HierarchyRequestError" DOMException if node is a shadow root.
Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttributeNode method. To create an attribute with a qualified name and namespace URI, use the createAttributeNS method.
Creates an attribute of the given qualified name and namespace URI. Per the XML Namespaces specification, applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.
Creates a CDATASection node whose value is the specified string.
Creates a Comment node given the specified string.
Creates an empty DocumentFragment object.
Creates an Element of the type specified. In addition, if there are known attributes with default values, Attr nodes representing them are automatically created and attached to the element. To create an Element with a qualified name and namespace URI, use the createElementNS method.
Creates an Element of the given qualified name and namespace URI. Per the XML Namespaces specification, applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.
Creates an EntityReference object. In addition, if the referenced entity is known, the child list of the EntityReference node is made the same as that of the corresponding Entity node.
Creates a ProcessingInstruction node given the specified name and data strings.
Creates a Text node given the specified string.
Returns the Element that has an ID attribute with the given value. If no such element exists, this returns null. If more than one element has an ID attribute with that value, what is returned is undefined. The DOM implementation is expected to use the attribute Attr.isId to determine if an attribute is of type ID.
Returns a NodeList of all the Elements in document order with a given tag name and are contained in the document.
Returns a NodeList of all the Elements with a given local name and namespace URI in document order.
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. The returned node has no parent; (parentNode is null).
This method acts as if the document was going through a save and load cycle, putting the document in a "normal" form. As a consequence, this method updates the replacement tree of EntityReference nodes and normalizes Text nodes, as defined in the method Node.normalize().
Rename an existing node of type ELEMENT or ATTRIBUTE.
The DocumentType associated with this document. For XML documents without a document type declaration this returns null.
This is a convenience attribute that allows direct access to the child node that is the document element of the document.
The location of the document or null if undefined or if the Document was created using DOMImplementation.createDocument. No lexical checking is performed when setting this attribute; this could result in a null value returned when using Node.baseURI.
The configuration used when Document.normalizeDocument() is invoked.
The DOMImplementation object that handles this document. A DOM application may use objects from multiple implementations.
An attribute specifying the encoding used for this document at the time of the parsing. This is null when it is not known, such as when the Document was created in memory.
An attribute specifying whether error checking is enforced or not. When set to false, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise any DOMException on DOM operations or report errors while using Document.normalizeDocument(). In case of error, the behavior is undefined. This attribute is true by default.
An attribute specifying, as part of the XML declaration, the encoding of this document. This is null when unspecified or when it is not known, such as when the Document was created in memory.
An attribute specifying, as part of the XML declaration, whether this document is standalone. This is false when unspecified.
An attribute specifying, as part of the XML declaration, the version number of this document. If there is no declaration and if this document supports the "XML" feature, the value is "1.0". If this document does not support the "XML" feature, the value is always null.
A code representing the type of the underlying object.
The name of this node, depending on its type.
Returns the local part of the qualified name of this node.
The namespace prefix of this node, or null if it is unspecified. When it is defined to be null, setting it has no effect, including if the node is read-only. Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable. Setting the prefix to null makes it unspecified, setting it to an empty string is implementation dependent. Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespaceURI and localName do not change. For nodes of any type other than ELEMENT and ATTRIBUTE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.
The namespace URI of this node, or null if it is unspecified. This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time. For nodes of any type other than ELEMENT and ATTRIBUTE and nodes created with a DOM Level 1 method, such as Document.createElement, this is always null.
The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI
The value of this node, depending on its type.
Returns the text content, if there's any.
Sets the text content, it there's any.
The parent of this node. All nodes, except Attr, Document, DocumentFragment, Entity, and Notation may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null.
A NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.
The first child of this node. If there is no such node, this returns null.
The last child of this node. If there is no such node, this returns null.
The node immediately preceding this node. If there is no such node, this returns null.
The node immediately following this node. If there is no such node, this returns null.
The Document object associated with this node. This is also the Document object used to create new nodes. When this node is a Document or a DocumentType which is not used with any Document yet, this is null.
A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
Returns whether this node (if it is an element) has any attributes.
Inserts the node newChild before the existing child node refChild. If refChild is null, insert newChild at the end of the list of children. If newChild is a DocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.
Removes the child node indicated by oldChild from the list of children, and returns it.
Returns whether this node has any children.
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent (parentNode is null) and no user data. User data associated to the imported node is not carried over. However, if any UserData handlers has been specified along with the associated data these handlers will be called with the appropriate parameters before this method returns.
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. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded.
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
Retrieves the object associated to a key on a this node. The object must first have been set to this node by calling setUserData with the same key.
Associate an object to a key on this node. The object can later be retrieved from this node by calling getUserData with the same key.
Compares the reference node, i.e. the node on which this method is being called, with a node, i.e. the one passed as a parameter, with regard to their position in the document and according to the document order.
Look up the prefix associated to the given namespace URI, starting from this node. The default namespace declarations are ignored by this method.
Look up the namespace URI associated to the given prefix, starting from this node.
This method checks if the specified namespaceURI is the default namespace or not.
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.