Contact Free trial Login

entrySet

entrySet(T)

Returns an array of key-value pairs that describe the key, value, and any attributes in the input object.

Parameters

Name Description

obj

The Object to describe.

Example

This example returns the key, value, and attributes in the object specified in the variable myVar.

Source

%dw 2.0
import * from dw::core::Objects
var myVar = read('<xml attr="x"><a>true</a><b>1</b></xml>', 'application/xml')
output application/json
---
{ "entrySet" : entrySet(myVar) }

Output

{
  "entrySet": [
    {
       "key": "xml",
       "value": {
         "a": "true",
         "b": "1"
       },
       "attributes": {
         "attr": "x"
       }
    }
  ]
}