Action: ModifyElementText

Purpose: Time-saving shortcut Action to quickly add or change the text inside a tag. This Action avoids the need for several primitive DOM Actions

If the specified Element does not have a Text Node, then a new one is created containing the specified text. If the Element already has a Text Node, its Data property is changed to contain the specified text.

This Action may only be applied to Element Nodes. Attempting to use it with any other Node Type will return an error

Action-specific name/value pairs:

Parameter Name Description
ElementOID The Element whose text you want to change
Text The new replacement text

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

{ElementOID:"6-11",Text:"This is replacement text for the selected tag"}

Example Request

Action=ModifyElementText
&ElementOID=6-11
&MDBAccessKeyId=[your access key id]
&Signature=[computed signature]
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Text=This%20is%20replacement%20text%20for%20the%20selected%20tag
&Timestamp=2009-06-14T13%3A19%3A41
&Version=2009-04-15
&db=mdbx

or:

Action=InsertNewIntermediateElement
&JSON=%7BElementOID%3A%226-11%22%2CText%3A%22This%20is%20replacement%20text%20for%20
 the%20selected%20tag%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

Example Response

XML

<?xml version='1.0'?>
<ModifyElementTextResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <ModifyElementTextResult>
      <TextNodeOID>
         6-8
      </TextNodeOID>
   </ModifyElementTextResult>
</ModifyElementTextResponse>

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

{TextNodeOID:"6-8"}

The response returns the OID of the text node that was created or changed as a result of this Action.