Action: GetParentNode

Purpose: Returns a pointer to the Parent Node of a specified Node.

Action-specific name/value pairs:

Parameter Name Description
NodeOID The OID of the node whose Parent node is to be retrieved.

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

{NodeOID:"1-7"}

Example Request

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

or:

Action=GetParentNode
&JSON=%7BNodeOID%3A%221-7%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'?>
<GetParentNodeResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <GetParentNodeResult>
      <NodeOID>
         1-2
      </NodeOID>
      <NodeType>
         1
      </NodeType>
      <TagName>
         test
      </TagName>
   </GetParentNodeResult>
</GetParentNodeResponse>

Note that this Action also retrieves the NodeType of the Parent node, and its TagName if the Parent Node is an Element.

The top-most node of a DOM is the DocumentNode (NodeType=9). Attempting to run the GetParentNode action against the DocumentNode will return an empty response, ie:

<?xml version='1.0'?>
<GetParentNodeResponse xmlns="http://mdbx.mgateway.com/doc/2009-06-05/">
   <GetParentNodeResult />
</GetParentNodeResponse>

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

{NodeOID:"1-2",NodeType:1,TagName:"test"}

Note that this Action also retrieves the NodeType of the Parent node, and its TagName if the Parent Node is an Element.

The top-most node of a DOM is the DocumentNode (NodeType=9). Attempting to run the GetParentNode action against the DocumentNode will return an empty response, ie:

{NodeOID:""}