How to apply Cdata to nodes of xml in BizTalk.

I have to map the below scenario but when i am  mapping it is changing the tag to < >

Input

<Details><Error><Id></id></error><Error><Id></id></error></Details>

Requried Output

<WSReq>

<ErrorDetails><![CDATA[<Error><Id></id></error><Error><Id></id></error>]]>

</ErrorDetails>

<WSReq>

Here the ErrorDetails element is  string.

Output i am getting is <ErrorDetails><![CDATA[&lt;Error&gt;&lt.........]]>

This is because  reading data into string.  Is there is any way i can control it

Please suggest


  • Edited by Phill Ed Saturday, May 30, 2015 2:35 AM
May 30th, 2015 2:34am

You have to set the CDATA section elements property of the Map.  Click on the design surface, then look in the Properties windows.

Then, you have to tell it what elements you want CDATA'd. In you example, it would be just "ErrorDetails". But if your schema has a targetNamespace, you have to use the qualified name which would almost certainly be "ns0:ErrorDetails".

Details: https://msdn.microsoft.com/en-us/library/aa562057.aspx

  • Proposed as answer by gennii Sunday, May 31, 2015 12:18 AM
  • Marked as answer by Phill Ed Sunday, May 31, 2015 12:26 AM
Free Windows Admin Tool Kit Click here and download it now
May 30th, 2015 12:38pm

You can also use xslt to control the o/p

<ns0:ErrorDetails xmlns:ns0="http://tempuri.org/">
<xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
<xsl:copy-of select="/*[local-name()='Details' and namespace-uri()='http://XYZ']/*[local-name()='Error' and namespace-uri()='']"/>
<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</ns0:ErrorDetails>


  • Edited by gennii Sunday, May 31, 2015 12:21 AM
  • Marked as answer by Phill Ed Sunday, May 31, 2015 12:26 AM
May 31st, 2015 12:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics