cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete child node from a XML SAP CPI without loosing the child content

0 Kudos

Hi Experts,

I am working on a scenario where the 3rd party sending numeric fields instead of field names. we can't create XSD for numeric due to xml limitations so I created a property for each field from the content modifier and calling the same in body. But for response case we may or may not receive the numeric tag based on some document number issue.

here is my the input I'm receiving:

<?xml version='1.0' encoding='UTF-8'?><root><data/><metadata><createdRecordIds/><lineErrors><1>The field with ID '6' has an invalid choice.</1></lineErrors><totalNumberOfRecordsProcessed>1</totalNumberOfRecordsProcessed><unchangedRecordIds/><updatedRecordIds/></metadata></root>

Typically in xml here is the input <lineErrors> <1> the field with id 6 has invalid choice </1> </lineErrors>. but I need to remove the child tag <1></1> and should retrieve content inside that tag.

Expected output : <lineErrors>the field with id 6 has invalid choice</lineErrors>.

Thanks

Kumar

View Entire Topic
Sriprasadsbhat
Active Contributor
0 Kudos

Hello Vinod,

There are different options you have

1) Use Graphical Message Mapping and pass the value of Node 1 to LineErrors ( you have to create target XSD without element "1" )

2) Write XSLT to transform the same.

Regards,

Sriprasad Shivaram Bhat