SAP ABAP IXML LIB PARSE



Get Example source ABAP code based on a different SAP table
  



ABAP_IXML - Parsing
XML data is parsed by a validating XML parser, which can be created using the iXML factory as follows: DATA(ixml) = cl_ixml=>create( ).

...

DATA(parser) = ixml->create_parser(
istream = ...
document = ...
stream_factory = ... ).
The static type of the reference variable parser is then the interface IF_IXML_PARSER. The parser requires the following input parameters:
The input stream istream to be parsed.
An XML document document, to which the stream is parsed.
A factory stream_factory must be specified for streams. This enables the parser to create corresponding streams if external sources are addressed in the parsed document.
A parser created in this way works like an iterator on the input stream. XML data can be parsed to a DOM representation in a single action or sequential parsing can be used, where the parser stops after certain steps and passes control to the application.
In addition to the parsers created using CREATE_PARSER, the factory method CREATE_TOKEN_PARSER can be used to create a token parser for direct parsing in ABAP data objects.



Latest notes:

A parser can only be used once for the associated input stream and the associated XML document. Once it has parsed the input stream to a document, the parser can be passed to the garbage collector. A parser cannot be reused for the same XML data or for any other data.
ABAP_HINT_END