Application Development and Automation 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: 
Read only

Reg CDATA Section in XML

Former Member
0 Kudos
581

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
Read only

athavanraja
Active Contributor
0 Kudos
358

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
Read only

athavanraja
Active Contributor
0 Kudos
359

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  ).]]>

Read only

Former Member
0 Kudos
358

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