Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg CDATA Section in XML

Former Member
0 Kudos
319

Hi all,

I have an issue with using the method <b>CREATE_CDATA_SECTION</b> of Interface IF_IXML_DOCUMENT.

I have created an XML file from ABAP using methods in IF_IXML_DOCUMENT etc.

The XML file is perfectly alright. But now there's a need to add CDATA section.

I need the CDATA section as follows in XML file...

<b><Description><![CDATA[test data]]></Description></b>

Can anybody help/advice me on this?

Regards

Ashok Parupalli.

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos
96

this is how i handle cdata section in my code

data: l_document                             type ref to if_ixml_document,
      l_data type ref to if_ixml_element ,
temp_string type string .

 clear temp_string .
concatenate   `<![CDATA[`
`First Line of Text`
`Second line of Text`
`Third Line of Text`
`` into temp_string separated by cl_abap_char_utilities=>newline.

  l_data = l_document->create_simple_element( parent = l_booklist name = 'DESC' value = temp_string  ).]]>

2 REPLIES 2

athavanraja
Active Contributor
0 Kudos
97

this is how i handle cdata section in my code

data: l_document                             type ref to if_ixml_document,
      l_data type ref to if_ixml_element ,
temp_string type string .

 clear temp_string .
concatenate   `<![CDATA[`
`First Line of Text`
`Second line of Text`
`Third Line of Text`
`` into temp_string separated by cl_abap_char_utilities=>newline.

  l_data = l_document->create_simple_element( parent = l_booklist name = 'DESC' value = temp_string  ).]]>

Former Member
0 Kudos
96

Hi,

I have a problem with the 'l_booklist', I declare it as 'l_booklist TYPE REF TO if_ixml_node' like in the interface but a shortdump comes up. must it be filled?

greets

Thomas