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: 

Display XML

Former Member
0 Kudos

Hi,

I have XML file in a string and i need to display it in a text box, how to do it Positioning all tags?

Thanks,

Priscila Pereira.

1 ACCEPTED SOLUTION

marcelo_ramos
Active Contributor

Hi,

Try this way.


data xml type string. 
data xml_document type ref to cl_xml_document.
data subrc type sysubrc.

  xml = '<?xml version="1.0" encoding="utf-16"?><a>123</a>'.

  "Instatiate the cl_xml_document object
  create object xml_document.

  "Send XML to method parse_string from class cl_xml_document
  subrc = xml_document->parse_string( xml ).

  "Finally display all XML with Tag using method display that organize Tags itself
  xml_document->display( ).

Regards,

Marcelo Ramos

1 REPLY 1

marcelo_ramos
Active Contributor

Hi,

Try this way.


data xml type string. 
data xml_document type ref to cl_xml_document.
data subrc type sysubrc.

  xml = '<?xml version="1.0" encoding="utf-16"?><a>123</a>'.

  "Instatiate the cl_xml_document object
  create object xml_document.

  "Send XML to method parse_string from class cl_xml_document
  subrc = xml_document->parse_string( xml ).

  "Finally display all XML with Tag using method display that organize Tags itself
  xml_document->display( ).

Regards,

Marcelo Ramos