Action: RemoveIntermediateNode

Purpose: Time-saving shortcut Action to remove a Node, but bringing its child Nodes up a level in the DOM tree. This Action avoids the need for several primitive DOM Actions

For example, suppose we had the following sub-tree in our XML document:

 <div id='a123'>
  <MyIntermediateNode>
   <myTag1>
    <mySubTag2>Some text
   </myTag1>
   <myTag2 />
   <myTag3 id="b2">
    <mySubTag />
   </myTag3>
  </MyIntermediateNode>
 </div>

Applying the RemoveIntermediateNode Action to the <MyIntermediateNode> tag would result in:

 <div id='a123'>
   <myTag1>
    <mySubTag2>Some text
   </myTag1>
   <myTag2 />
   <myTag3 id="b2">
    <mySubTag />
   </myTag3>
 </div>

The effect is to shuffle the child nodes (and their sub-trees) up a level to replace the deleted node.

This is a powerful and very useful Action for use when transforming XML documents.

Note: the removed node can either be left unattached but in the DOM Document, or permanently deleted from the DOM.

Action-specific name/value pairs:

Parameter Name Description
NodeOID The OID of the Intermediate Node that is to be removed.
DeleteFromDOM (optional; default=false) If present, this parameter should be true or false. If true, the specified Node is permanently deleted from the Document.

By default, removal of the Node leaves it in the Document but detached from the Document tree.

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

{NodeOID:"1-3",DeleteFromDOM:true}

Example Request

Action=RemoveIntermediateNode
&DeleteFromDOM=true
&MDBAccessKeyId=[your access key id]
&NodeOID=1-3
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&TagName=MyIntermediateNode
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

or:

Action=RemoveIntermediateNode
&JSON=%7BNodeOID%3A%221-3%22%2CDeleteFromDOM%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'?>
<RemoveIntermediateNodeResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/" />

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

{ok:true}