AnsweredAssumed Answered

Map function

Question asked by vijay.bontapalli137242 on Jun 15, 2016
Latest reply on Jun 16, 2016 by vkomarina376761

Hi, Can someone help me with below transformation.

Input: (XML)

<?xml version = "1.0" encoding = "UTF-8"?>

<resultSet>

  <Record>

  <ITEM>GBP=</ITEM>

  <BID>1.4428</BID>

  <ASK>1.4432</ASK>

  <VALUE_DT1>16 NOV 16</VALUE_DT1>

  </Record>

  <Record>

  <ITEM>BYR=</ITEM>

  <BID>19960</BID>

  <ASK>20030</ASK>

  </Record>

</resultSet>

 

Desired output: (JSON)

{

    "results" :[

  { "ticker" : "GBP=", "attrName" : "BID", "attrValue" : "1.4428" },

  { "ticker" : "GBP=", "attrName" : "ASK", "attrValue" : "1.4432" },

  { "ticker" : "GBP=", "attrName" : "VALUE_DT1", "attrValue" : "16 NOV 16" },

  { "ticker" : "BYR=", "attrName" : "BID", "attrValue" : "19960" },

  { "ticker" : "BYR=", "attrName" : "ASK", "attrValue" : "20030" },

    ]

}

 

Is this tranformation possible, WITHOUT writing any Groovy or Java script?

Thanks in advance.

Outcomes