A document is the root of the document tree, providing primary access to the data and content structure. When opening a DOM interface using WITH-OPEN-DOM, the resulting object is typically a DOM document.
create-attribute document name
The create-attribute method creates an attribute node. This node can later be set to an element using set-attribute. the method takes two arguments: The current document, and the name of the attribute.
create-attribute-ns document namespace-uri qualified-name
Creates an attribute in the given namespace.
create-document-fragment document
The create-document-fragment method creates an empty document fragment object. It takes one argument: The current document.
create-element document tagname
The create-element method creates an element of a given type, and returns the new element. The element has to be inserted into the document afterwards. The method takes two arguments: A document, and the name of the element type (e.g. "P" for paragraph).
create-element-ns document namespace-uri qualified-name
Creates an element of the given qualified name and namespace.
create-text-node document data
The create-text-node method creates a text node given the specified string. It takes two arguments: The current document, and the text string.
create-comment document data
The create-comment method creates a comment given a specified string. It takes two arguments: The current document, and the text string.
create-cdata-section document data
The create-cdata-section method creates a CDATA section node whose value is a specified string. It takes two arguments: The current document, and the text string.
create-processing-instruction document target data
The create-processing-instruction method creates a processing instruction. It takes three arguments: The current document, a processing instruction target, and the data for the instruction.
create-entity-reference document name
The create-entity-reference method creates an entity reference. The method takes two arguments: A document, and the name of the entity to reference.
-doctype document
The doctype attribute provides the Document Type Declaration associated with the document, or NIL if it has no document type declaration.
document-element document
The document-element attribute provides the root element of the document. For example, the root element of a HTML document is the element named "HTML".
get-element-by-id document element-id
get-elements-by-tag-name document tagname
The get-elements-by-tag-name returns a nodelist of all the elements with a given tag name. The method takes two arguments: A document, and the name of the tag to match on ("*" matches all tags).
get-elements-by-tag-name-ns document namespace-uri local-name
Returns a nodelist of all the elements with a given local name and namespace uri in the order in which they would be encountered in a preorder traversal of the document tree.
import-node document node deep
Imports a node from another document to this document.
implementation document
The implementation attribute provides the DOM Implementation object that handles the document.