Document.adoptNode(options)
Method Description |
Attempts to adopt a node from another document to this document. If successful, this method changes the Node.ownerDocument property of the source node, its children, and any attribute nodes to the current document. If the source node has a parent node, the parent node is first removed from the child list of its own parent node.
Important:
This method is not supported on Internet Explorer. |
Returns |
|
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
required |
Source node to add as a child into the current node object. |
Errors
Error Code |
Message |
Thrown If |
---|---|---|
|
NOT_FOUND_ERR: An attempt is made to reference a node in a context where it does not exist. |
Node cannot be adopted. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/xml Module Script Samples.
//Add additional code
...
var adoptedNode = xmlDocument1.adoptNode({
source : sourceNode,
});
...
//Add additional code