cancel
Showing results for 
Search instead for 
Did you mean: 

WRAP a XML file within CDATA

Former Member
0 Kudos

Dear All,

My requirement is to wrap Individual node data of an XML file within CDATA tag and then to wrap the whole XML file within CDATA.

As an example if my XML :

<?xml version="1.0" encoding="utf=8"?>

<MAIN_NODE>

<PHONENUMBER>+31640642821</PHONENUMBER>

<PLANT>NL93</PLANT>

<ORDER>21019410</ORDER>

<PARNR>300146</PARNR>

<PROCESS>SPS</PROCESS>

</MAIN_NODE>

The I need to WRAP whole XML within CDATA and also individual node data within CDATA tag, so finally my XML should appear something like this

<?xml version="1.0" encoding="utf=8"?>

<SAPMESSAGE>

-<BODYTEXT><![CDATA[

<?xml version="1.0" encoding="utf=8"?>

<MAIN_NODE>

<PHONENUMBER><![CDATA[ +31640642821 ]]</PHONENUMBER>

<PLANT><![CDATA[ NL93 ]]</PLANT>

<ORDER><![CDATA[ 21019410 ]]</ORDER>

<PARNR><![CDATA[ 300146 ]]</PARNR>

<PROCESS><![CDATA[ SPS< ]]/PROCESS>

</MAIN_NODE>

]]></BODYTEXT>

</SAPMESSAGE>

Thank you for your help.

Kind Regards,

Ravi

Edited by: Ravi Santani on Mar 15, 2010 3:19 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I Have got the solution to this problem, so closing the forum.