ownerDocument
of a node, its children, as well as the attached attribute nodes if there are any. If the node has a parent it is first removed from its parent child list. This effectively allows moving a subtree from one document to another. The following list describes the specifics for each type of node. ownerElement
attribute is set to null
and the specified
flag is set to true
on the adopted Attr
. The descendants of the source Attr
are recursively adopted.Document
nodes cannot be adopted.DocumentType
nodes cannot be adopted.Attr
nodes. Default attributes are discarded, though if the document being adopted into defines default attributes for this element name, those are assigned. The descendants of the source element are recursively adopted.Entity
nodes cannot be adopted.EntityReference
node itself is adopted, the descendants are discarded, since the source and destination documents might have defined the entity differently. If the document being imported into provides a definition for this entity name, its value is assigned.Notation
nodes cannot be adopted.Note: Unlike the Document.importNode()
method, this method does not raise an INVALID_CHARACTER_ERR
exception and applications should use the Document.normalizeDocument()
method to check if an imported name contain an illegal character according to the XML version in use.
@param source The node to move into this document.
@return The adopted node, or null
if this operation fails, such as when the source node comes from a different implementation.
@exception DOMException NOT_SUPPORTED_ERR: Raised if the source node is of type DOCUMENT
, DOCUMENT_TYPE
.
NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is readonly.
@since DOM Level 3
|
|
|
|
|
|