Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/XML-DOM-serialization/ABAP/xml-dom-serialization.abap
Normal file
19
Task/XML-DOM-serialization/ABAP/xml-dom-serialization.abap
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
DATA: xml_string TYPE string.
|
||||
|
||||
DATA(xml) = cl_ixml=>create( ).
|
||||
DATA(doc) = xml->create_document( ).
|
||||
DATA(root) = doc->create_simple_element( name = 'root'
|
||||
parent = doc ).
|
||||
|
||||
doc->create_simple_element( name = 'element'
|
||||
parent = root
|
||||
value = 'Some text here' ).
|
||||
|
||||
DATA(stream_factory) = xml->create_stream_factory( ).
|
||||
DATA(stream) = stream_factory->create_ostream_cstring( string = xml_string ).
|
||||
DATA(renderer) = xml->create_renderer( document = doc
|
||||
ostream = stream ).
|
||||
stream->set_pretty_print( abap_true ).
|
||||
renderer->render( ).
|
||||
|
||||
cl_demo_output=>display_text( xml_string ).
|
||||
Loading…
Add table
Add a link
Reference in a new issue