cancel
Showing results for 
Search instead for 
Did you mean: 

Disable CDATA conversion after mapping

Former Member
0 Kudos

Hi All,

I've got a scenario where I have to map a IDoc to a Webservice. The webservice accepts the data as following:


<SendMessage>

       <message>

            <![CDATA[ <comtec> ... </comtec> ]]>

       </message>

</SendMessage>

I've got my XSLT mapping as the following:


<?xml version="1.0" ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" xmlns:cais="">

  <xsl:output method="xml" encoding="UTF-8" cdata-section-elements="text"/>

  <xsl:template match="/">

    <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

      <ns0:Message1>

        <xsl:for-each select="ns0:Messages/ns0:Message1/comtec">

          <cais:SendMessage xmlns:ns1="http://www.xxx.com/">

            <cais:message>

              <xsl:text disable-output-escaping="yes">&lt;![CDATA[ </xsl:text>

              <xsl:copy-of select="." />

              <xsl:text disable-output-escaping="yes"> ]]&gt; </xsl:text>

            </cais:message>

            <cais:commandName>CCDMSimport</cais:commandName>

          </cais:SendMessage>

        </xsl:for-each>

      </ns0:Message1>

    </ns0:Messages>

  </xsl:template>

</xsl:stylesheet>

When I test the XSLT in the Message Mapping I'm getting the exact result as described above. But when the file is processed by the receiving adapter (e.g. a File Receiver to test the result). I get the following result:


<?xml version="1.0" encoding="UTF-8"?>

<SendMessage>

  <cais:message> &lt;comtec &gt; ... &lt;/comtec&gt;  </cais:message>

</SendMessage>

As you can see, the whole "CDATA" declaration is gone and all special characters have been encoding to HTML entities.Is there a way to disable this convertion? I assume the conversion is done right after the message mapping. Because the message is encoded already when I check the Message Monitoring after the mapping.

(I've already tried to change the File receiver encoding to ISO and UTF).

Hoping someone can help me.

Koen Schouten

Accepted Solutions (0)

Answers (1)

Answers (1)

chrismills
Explorer
0 Kudos

Hi Koen,

What release are you on? Using the 7.40 file adapter on a single stack I don't get issues with the CDATA being escape, however, it didn't like your XSL having a blank value for the cais NS declaration (xmlns:cais="")

Cheers

Chris

Former Member
0 Kudos

Hi Chris,

I'm using the 7.31 Single stack.

I've just leaved the cais namespace empty because I would like to anonimize my endpoint .

I've tried to set the encoding in my File receiver. But with ISO or UTF-8, I both get the same result.