SAP ABAP IXML LIB INPUT OUTPUT
Get Example source ABAP code based on a different SAP table
ABAP_IXML - Streams and Documents
ITOC
Input Streams and Output Streams
Input streams are used for the input of XML data into the
...
DATA(stream_factory) = ixml->create_stream_factory( ).>
The static type of the reference variable
Different streams can be created for different data sources and data sinks, such as strings, internal tables, or files specified by URI.
Latest notes:
ABAP_HINT_END
Example ABAP Coding
The XML result of a transformation of an ABAP data object to the
RESULT XML DATA(xml_string).
DATA(ixml) = cl_ixml=>create( ).
DATA(stream_factory) = ixml->create_stream_factory( ).
DATA(istream) = stream_factory->create_istream_xstring( xml_string ).
DATA result TYPE string.
CALL TRANSFORMATION id SOURCE XML istream
RESULT text = result.>
ABAP_EXAMPLE_END
XML Documents
Each XML stored in DOM format in the memory is managed using a separate object. An object of this type can be created as follows:
...
DATA(document) = ixml->create_document( ).>
The static type of the reference variable
Latest notes:
iXML documents can be defined as an XML target, iXML documents and their nodes can be specified as an XML source for XSL transformations called using
ABAP_HINT_END
Example ABAP Coding
A document is created and used as the XML target of an XSL transformation. The filled document is then passed to a renderer to which an output stream for a character string is bound simultaneously and rendered. The character string then contains the character-like representation of the XML data.
DATA(document) = ixml->create_document( ).
CALL TRANSFORMATION id SOURCE text = `Hello XML!`
RESULT XML document.
DATA xml_string TYPE string.
ixml->create_renderer( document = document
ostream = ixml->create_stream_factory(
)->create_ostream_cstring(
string = xml_string )
)->render( ).>
ABAP_EXAMPLE_END