Action: ImportNode

Purpose: Copies a Node and, optionally the sub-tree underneath it, from one DOM to another. The top copied node is left unattached to any other node in the DOM into which it has been copied.

You can attach it to its DOM tree at a later time using either the AppendChild or InsertBefore Action

Action-specific name/value pairs:

Parameter Name Description
FromNodeOID The Node to be copied.
DocumentName or DocumentOID The Name or OID of the document into which the FromNode is to be copied.
DeepCopy (optional) Possible values are true or false.

If set to false, the FromNode is copied but its sub-tree of child nodes is ignored.

By default, DeepCopy is set to true: a deep copy is performed, so the FromNode and its sub-tree will be copied into the other DOM.

Alternatively, the parameters above can be incorporated into a single JSON string and specified using the parameter name JSON, eg:

{FromNodeOID:"1-3",DocumentName:"example",DeepCopy:true}

Example Request

Action=ImportNode
&DeepCopy=true
&DocumentName=example
&FromNodeOID=1-3
&MDBAccessKeyId=[your access key id]
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

or:

Action=ImportNode
&JSON=%7BFromNodeOID%3A%221-3%22%2CDocumentName%3A%22example%22%2CDeepCopy%3Atrue%7D
&MDBAccessKeyId=[your access key id]
&OutputFormat=JSON
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

Example Response

XML

<?xml version='1.0'?>
<ImportNodeResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <ImportNodeResult>
      <NodeOID>
         3-37
      </NodeOID>
   </ImportNodeResult>
</ImportNodeResponse>

JSON (ie if OutputFormat=JSON specified in the Request)

{NodeOID:"3-37"}

The OID assigned to the newly-created copy of the FromNode in the document named example was 3-37.