Action: CreateCDataSection

Purpose: Creates a new CDATA Section Node and optionally appends it into its owner DOM.

If you don't attach the newly created node, 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
Data The Data content of the CDATA Section. This must be correctly URL-escaped as appropriate.
DocumentName or DocumentOID The Name or OID of the DOM in which you wish to create the new Node.
AppendTo (optional) The OID of the Node to which the newly-created Node will be appended as a Last Child. If not specified, the newly created Node will be left unattached in the Document.

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

{Data:"This is the content of my new CDATA Section",DocumentName:"example",AppendTo:"1-1"}

Example Request

Action=CreateCDataSection
&Data=This%20is%20the%20content%20of%20my%20new%20CDATA%20Section
&DocumentName=example
&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=CreateCDataSection
&JSON=%7BData%3A%22This%20is%20the%20content%20of%20my%20new%20CDATA%20Section%22%2C
 DocumentName%3A%22example%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 the following node in the DOM named example:

<![CDATA[This is the content of my new CDATA Section]]>

Example Response

XML

<?xml version='1.0'?>
<CreateCDataSectionResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <CreateCDataSectionResult>
      <NodeOID>
         1-29
      </NodeOID>
      <NodeType>
         4
      </NodeType>
   </CreateCDataSectionResult>
</CreateCDataSectionResponse>

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

{NodeOID:"1-29",NodeType:4}

The OID assigned to the newly-created CDATA section Node was 1-29. Note that the NodeType (CDATA Section = 4) is also returned for information only.