ABAP Keyword Documentation →  ABAP − Reference →  Data Interfaces and Communication Interfaces →  ABAP and XML →  Class Libraries for XML →  iXML Library → 

iXML Library - Parse

XML data is parsed by a validating XML parser, itself 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:

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.

Alongside the parsers created using CREATE_PARSER, the factory method CREATE_TOKEN_PARSER can be used to create a token parser for direct parsing to ABAP data objects.

Note

A parser is only valid 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.




Continue
iXML Library - Complete Parse to DOM
iXML Library - Sequential Parsing
iXML Library - Parsing to Data Objects
iXML Library - Troubleshooting After Parsing