Skip to Content

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

CDATA XML Tags - Special Char

Hi Experts,

I am working on interface where in i have to send CDATA XML tag in Target structure, I have checked their are couple of discussions about the requirement but not very helpful for my case.

My Scenario :

Expected :

SOURCE TextH( TextC ) ---------TARGET <TextH> <![CDATA[TextC]]><TextH>

Currently :

SOURCE TextH( TextC ) --------- TARGET <TextH>&lt;![CDATA[TextC]]&gt;<TextH>

So instead of < and > this characters are getting replaced with  &lt;  and &gt;

Any solution how can i avoid this transformation of special characters when sending to Target

Thanks in Advance,



Former Member
Former Member replied

Please try




public class Test_JavaMapping extends AbstractTransformation {     


    public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {     

        try {     

            InputStream inputstream = transformationInput.getInputPayload().getInputStream();     

            OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();     

            // Copy Input content to Output content     

            byte[] b = new byte[inputstream.available()];     



            String input = new String(b);

            String output = input.replace("&lt;![CDATA[", "<![CDATA[").replace("]]&gt;", "]]>");


        } catch (Exception exception) {     


            throw new StreamTransformationException(exception.toString());     




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