Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Adding comment line in XML message

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

Former Member
Former Member 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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question