Action: RemoveAttribute

Purpose: Removes an attribute from a tag.

More formally stated, this Action detaches an Attribute Node from an Element and optionally deletes it from the DOM. If not deleted, the Attribute Node is left in the DOM Document but it is left unattached to the main Document tree.

This Action may only be applied to Element Nodes. Attempting to use it with any other Node Type will return an error. The Action will not return an error if the Element does not possess the named attribute.

Action-specific name/value pairs:

Parameter Name Description
ElementOID The Element Node that contains the attribute you wish to remove
AttributeName The name of the Attribute you want to remove
DeleteFromDOM (optional; default=false) If present, this parameter should be true or false. If true, the Attribute node and its associated data is permanently deleted from the Document.

By default, removal of the attribute 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:

{ElementOID:"1-3",AttributeName:"onclick",DeleteFromDOM:true}

Example Request

Action=RemoveAttribute
&AttributeName=onclick
&DeleteFromDOM=true
&ElementOID=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=RemoveAttribute
&JSON=%7BElementOID%3A%221-3%22%2CAttributeName%3A%22onclick%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'?>
<RemoveAttributeResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/" />

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

{ok:true}