cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove xmlns from xml data and add indentation in sap cpi

vineetha12
Participant
0 Kudos
439

Hi,

I have below XML data, I need to remove the xmlns and add indentation to the data. Does anyone, please provide a solution for it?

XML data:

The response should be in the below format:

Thanks,

Vineetha.

Accepted Solutions (0)

Answers (1)

Answers (1)

nshivaprasad5334
Participant
0 Kudos

Hi Vineetha,

You can replace the namespace with a blank value.

Let me know if the below code works for you.

Thanks

Shiva

VijayKonam
Active Contributor
0 Kudos

Try This -

import groovy.xml.* // Pretty print a non-formatted XML String. def xmlString = 'Your XML here'

def prettyXML = XmlUtil.serialize(xmlString)