- 126 -
of a copy-constructor. If deep is false, then the node is copied, but its children are
ignored. If deep is true, then a complete replica of the subtree starting at the current node
is returned.
Comments
: Calling cloneNode(true) can result in a very processing-intensive operation,
especially if called on the Document node of a large document.
Document
Parent
: Node
The Document node is not an element; rather it represents the document as a whole. In
data islands, the id attribute on the
tag is a reference to the Document node.
The Document node is the root node that contains the facilities to manage the various
nodes beneath it. More specifically, the Document node is used to create nodes that can
later be inserted into the tree. Also included is a basic searching mechanism. In addition
to these facilities, the Document node contains pointers to other important nodes in the
tree, such as the root Element node and the DocumentType node.