AnsweredAssumed Answered

How to process dynamic xml content

Question asked by ankit.goyal349421 on Aug 30, 2018
Latest reply on Aug 31, 2018 by ankit.goyal349421

We have a xml containing some information in generic tags like this: 

<?xml version="1.0" encoding="UTF-8"?> <TransactionSearchRow> <basic> <type> <searchValue>_journal</searchValue> </type> <customFieldList> <customField internalId="299" scriptId="custcol_cseg_region"> <searchValue internalId="322" typeId="79" /> </customField> <customField internalId="407" scriptId="custcol_cseg_event_year"> <searchValue internalId="5" typeId="100" /> </customField> <customField internalId="2261" scriptId="custcol_cseg_spend_cat_lev3"> <searchValue internalId="1159" typeId="389" /> </customField> <customField internalId="1111" scriptId="custcol_cseg_acs_act_prod"> <searchValue internalId="33005" typeId="177" /> </customField> <customField internalId="2398" scriptId="custcol_cseg_association"> <searchValue internalId="7" typeId="699" /> </customField> <customField internalId="387" scriptId="custcol_cseg_fund_code"> <searchValue internalId="7002" typeId="96" /> </customField> </customFieldList> </basic> </TransactionSearchRow>

 

Please note that is generic tag where all information coming in as different attribute list. What we want to convert to is something like:

<?xml version="1.0" encoding="UTF-8"?> <TransactionSearchRow> <Basic> <type> <searchValue>_journal</searchValue> </type> <custcol_cseg_region>322</custcol_cseg_region> <custcol_cseg_event_year>322</custcol_cseg_event_year> <custcol_cseg_spend_cat_lev3>322</custcol_cseg_spend_cat_lev3> <custcol_cseg_acs_act_prod>322</custcol_cseg_acs_act_prod> </Basic> </TransactionSearchRow>

 

Is there any way we can achieve this?

Outcomes