Action: InsertNewFirstChildElement

Purpose: Time-saving shortcut Action to create a new Element and add it as the new First Child node of a specified parent Node. This Action avoids the need for several primitive DOM Actions

Action-specific name/value pairs:

Parameter Name Description
TagName The TagName of the new Element you want to create
ParentOID The OID of the Node to which the new Element will be added as a First Child Node.

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

{TagName:"div",ParentOID:"1-3"}

Example Request

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

or:

Action=InsertNewFirstChildElement
&JSON=%7BTagName%3A%22div%22%2CParentOID%3A%221-3%22%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

This request will create a <div> tag and add it as the new First Child of the Node whose OID is 1-3.

Example Response

XML

<?xml version='1.0'?>
<InsertNewFirstChildElementResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <InsertNewFirstChildElementResult>
      <ElementOID>
         1-10
      </ElementOID>
   </InsertNewFirstChildElementResult>
</InsertNewFirstChildElementResponse>

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

{ElementOID:"1-10"}