DATA : lr_ixml TYPE REF TO if_ixml, lr_doc TYPE REF TO if_ixml_document, lr_root_elem TYPE REF TO if_ixml_element, lr_node1_elem TYPE REF TO if_ixml_element, lr_stream TYPE REF TO if_ixml_stream_factory, lr_ostream TYPE REF TO if_ixml_ostream, lr_render TYPE REF TO if_ixml_renderer, xml_string TYPE string.
lr_ixml = cl_ixml=>create( 0 ). * Get reference of the document lr_doc = lr_ixml->create_document( ). * get reference of the root lr_root_elem = lr_doc->create_simple_element_ns( prefix = 'asx' name = 'test' parent = lr_doc ). * Add root element attributes lr_root_elem->set_attribute_ns( name = 'asx' prefix = 'xmlns' value = 'http://www.sap.com/testxml' ). lr_root_elem->set_attribute_ns( name = 'version' value = '1.0' ).
* Get reference of the first node of teh root lr_node1_elem = lr_doc->create_simple_element_ns( prefix = 'asx' name = 'names' parent = lr_root_elem ).
* add node 1 to the document lr_doc->create_simple_element_ns( name = 'name' value = 'SAP' parent = lr_node1_elem ).
Social Plugin