cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Adding comment line in XML message

Former Member
0 Likes
4,957

Hi,

Does anyone know how to add a comment line in outgoing XML message from XI? Using graphical mapping or java or adapter module?

Something like .....

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

<! this is a comment>

<record>

Thanks

Pushpinder

View Entire Topic
Former Member
0 Likes

You can write below statement in simple java mapping

As you want to insert comment before <record>

read entire source structure in string strXMLSource

finalString = strXMLSource.replaceAll("<record>", "<!-- this is a comment--><record>");

in out.write statement pass finalString....

No need to write any parser, just write simple code in execute method