Adding comment line in XML message
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>
Mugdha Kulkarni replied
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