Click or drag to resize
IDocument Methods

The IDocument type exposes the following members.

Methods
  NameDescription
Public methodAppendChild
Adds the node
newChild
to the end of the list of children of this node. If the
newChild
is already in the tree, it is first removed.
(Inherited from INode.)
Public methodCloneNode (Inherited from INode.)
Public methodCreateAttribute
Public methodCreateAttributeNS
Creates an attribute of the given qualified name and namespace URI. HTML-only DOM implementations do not need to implement this method.
Public methodCreateCdataSection
Creates a
CDATASection
node whose value is the specified string.
Public methodCreateComment
Creates a
Comment
node given the specified string.
Public methodCreateDocumentFragment
Creates an empty
DocumentFragment
object.
Public methodCreateElement
Public methodCreateElementNS
Public methodCreateEntityReference
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.If any descendant of the
Entity
node has an unbound namespace prefix, the corresponding descendant of the created
EntityReference
node is also unbound; (its
namespaceURI
is
null
). The DOM Level 2 does not support any mechanism to resolve namespace prefixes.
Public methodCreateProcessingInstruction
Creates a
ProcessingInstruction
node given the specified name and data strings.
Public methodCreateTextNode
Creates a
Text
node given the specified string.
Public methodGetElementById
Returns the
Element
whose is given by
elementId
. If no such element exists, returns
null
. Behavior is not defined if more than one element has this . The DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to return
null
.
Public methodGetElementsByTagName
Returns a
NodeList
of all the
Elements
with a given tag name in the order in which they are encountered in a preorder traversal of the
Document
tree.
Public methodGetElementsByTagNameNS
Returns a
NodeList
of all the
Elements
with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the
Document
tree.
Public methodHasAttributes
Returns whether this node (if it is an element) has any attributes.
(Inherited from INode.)
Public methodHasChildNodes
Returns whether this node has any children.
(Inherited from INode.)
Public methodImportNode
Public methodInsertBefore
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.
(Inherited from INode.)
Public methodIsSupported
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
(Inherited from INode.)
Public methodNormalize
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, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.In cases where the document contains
CDATASections
, the normalize operation alone may not be sufficient, since XPointers do not differentiate between
Text
nodes and
CDATASection
nodes.
(Inherited from INode.)
Public methodRemoveChild
Removes the child node indicated by
oldChild
from the list of children, and returns it.
(Inherited from INode.)
Public methodReplaceChild (Inherited from INode.)
Top
See Also