AnsweredAssumed Answered

xml massaging

Question asked by ram.muddana501196 on Mar 17, 2016
Latest reply on Mar 17, 2016 by ram.muddana501196

I am working on massaging an xml data . I could do this using xslt transformations in tibco, but finding it difficult in boomi.

 

Whenever a VALUE element contains U-NODE / NX, I should create another Item element with value FILLER. Any thoughts on how this can be implemented ?

 

 

input xml data

 

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

<SO>

<ItemList>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>1</InternalId>

  <Value>U-NODE-XYZ</Value>

  </Item>

  </CustomFieldList>

  </Item>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>2</InternalId>

  <Value>MB0-RET</Value>

  </Item>

  </CustomFieldList>

  </Item>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>3</InternalId>

  <Value>NX-321</Value>

  </Item>

  </CustomFieldList>

  </Item>

</ItemList>

</SO>

 

 

output data xml

 

 

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

<SO>

<ItemList>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>xx</InternalId>

  <Value>FILLER</Value>

  </Item>

  </CustomFieldList>

  </Item>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>1</InternalId>

  <Value>U-NODE-XYZ</Value>

  </Item>

  </CustomFieldList>

  </Item>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>2</InternalId>

  <Value>MB0-RET</Value>

  </Item>

  </CustomFieldList>

  </Item>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>yy</InternalId>

  <Value>FILLER</Value>

  </Item>

  </CustomFieldList>

  </Item>

  <Item>

  <CustomFieldList>

  <Item>

  <InternalId>3</InternalId>

  <Value>NX-321</Value>

  </Item>

  </CustomFieldList>

  </Item>

</ItemList>

</SO>

Outcomes