Name

adoptNode: adoptNode, source(3)

Synopsis

Similar to importNode( ), this method is used to migrate a DOM Node from one Document instance to another. The source node is removed from the DOM tree of its parent document and prepared to be inserted into the adopting document, unlike the importNode() method which creates a copy of the source node and leaves the original in place. The following table explains the behavior of this method for the individual node types:

Since the newly adopted node was not created by the target document, it is possible that the names of elements, attributes, etc., may not conform to the XML version of the new document (see the xmlVersion attribute). Consider using the normalizeDocument( ) method to ensure that adopted nodes are well-formed.