cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting a new line after each tag of an xml

Former Member
0 Kudos

Hi,

I am having a requirement where i need to insert a newline after each tag<> of an xml. I am sending an xml to target system using JMS adapter and the target system has UNIX as OS.

In unix system if we see the output xml, it will be in a single string as shown

<?xml version="1.0" encoding="ISO-8859-1"?><messages><Field1\><Field2\>.........................</messages>

But the desired output should be in the below format

<?xml version="1.0" encoding="ISO-8859-1"?>

<messages>

<Field1\>

<Field2\>

.

.

.

.

.

</messages>

And there should not be any indentation for the xml. It should be in the above format it self.

Accepted Solutions (0)

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

I believe this can be achieved through XSLT or JAVA Mapping.

Please refer to the following link:

XSLT Mapping:

JAVA Mapping:

In Java Mapping ,all you have to do is to make a code that does a search and replace.

Hope this helps,