AnsweredAssumed Answered

How can i customize a xml content to a specific extent

Question asked by irfan.mugale on Jul 29, 2017
Latest reply on Jul 31, 2017 by irfan.mugale

Hello Everyone,


I am getting a request in the below format from a database using JDBC query

They are recurring. As shown below is the one set of values there will be n number of sets which we dont know 


<L7j:col name="asub" type="java.lang.String">CONQP</L7j:col>
<L7j:col name="asset" type="java.lang.String">CNE</L7j:col>
<L7j:col name="esc" type="java.lang.String">AAN</L7j:col>
<L7j:col name="date" type="java.sql.Timestamp">2017-03-29 14:32:11.0</L7j:col>
<L7j:col name="by" type="java.lang.String">KXT=08</L7j:col>
<L7j:col name="acry" type="java.lang.String">COQP</L7j:col>
<L7j:col name="modby" type="java.lang.String">CLOVPPORT</L7j:col>
<L7j:col name="mel" type="java.lang.String">ACANE</L7j:col>
<L7j:col name="avdt" type="java.sql.Timestamp">2017-03-29 00:00:00.0</L7j:col>
<L7j:col name="crete" type="java.sql.Timestamp">2001-12-12 17:53:30.0</L7j:col>
<L7j:col name="ldc" type="java.lang.String">AANE</L7j:col>
<L7j:col name="me" type="java.lang.String">AE</L7j:col>



I need to customize it to a below format


<date>2017-03-29 14:32:11.0</date>
<avdt>2017-03-29 00:00:00.0</avdt>
<crete>2001-12-12 17:53:30.0</crete>


Same as above with different values.




AS I need to customize it to above format because it will be easy to convert in to json as backend accepts only json 




"date":"2017-03-29 14:32:11.0",
"avdt":"2017-03-29 00:00:00.0",
"crete":"2001-12-12 17:53:30.0",



Problem is i am not able to convert the xml packet which is comming to gateway into the required json format which backend needs.

The above are 12 tags elements which will but they are recurring 


Please suggest what i can do to meet the requirement.


So Please help on this