cancel
Showing results for 
Search instead for 
Did you mean: 

How do I map CData content in ESR?

Former Member
0 Kudos
2,690

Hi,

I'm trying to map the following message:

<XML_Message>

<Data>

<Payload><![CDATA[<p>Just some example</p>]]></Payload>

</Data>

</XML_Message>

Unfortunately, the CData section is removed and all the HTML tags are escaped when mapping to another message. I don't use XSLT, so maybe that is my problem. I want the message to stay like it is, with CData and all.

Can someone tell me what to do?

View Entire Topic
former_member182412
Active Contributor

Hi Zakaria,

Use below UDF to keep CDATA in the output.

public String retainCDATA(String input, Container container) throws StreamTransformationException {
		return "<![CDATA[" + input + "]]>";
	}

Mapping Test:

In the mapping test tab it shows with escape characters because with in the element less than and greater than symbols are by default escaped but when i open the output in XML Notepad it shows CDATA.

Regards,

Praveen.

Former Member
0 Kudos

See my reply. Thank you

0 Kudos

Hi Praveen

I got a problem.

Where is the input comes from?

Regards.