The DOM Document

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

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

create-attribute-ns document namespace-uri qualified-name

Creates an attribute in the given namespace.

Create Document Fragment

create-document-fragment document

The create-document-fragment method creates an empty document fragment object. It takes one argument: The current document.

Create Element

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

create-element-ns document namespace-uri qualified-name

Creates an element of the given qualified name and namespace.

Create Text Node

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

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

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

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

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

-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-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

get-element-by-id document element-id

Returns the whose ID is given by element-id. If no such element exists, returns NIL. Behavior is not defined if more than one element has this ID.

Get Elements By Tag Name

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

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

import-node document node deep

Imports a node from another document to this document.

Implementation

implementation document

The implementation attribute provides the DOM Implementation object that handles the document.