iXML Library - Sequential Parsing
To parse XML data sequentially, a dedicated parser is called multiple times as follows:
DATA(event) = parser->parse_event( ).
parser is a reference variable that points to the parser. The method
PARSE_EVENT returns a reference variable with the type IF_IXML_EVENT that
points to an object representing an event that occurred during parsing. The parser processes the input
in sequences defined by the events for which the caller registered itself earlier. The possible events
are saved as constants
co_event... in the interface IF_IXML_EVENT. They are registered using the method
The parser pauses after every event registered like this and uses the object referenced by
to return the properties of the current sequence. The method PARSE_EVENT must be called again to edit the next sequence. If all XML data was parsed or if an error occurred, the return value of PARSE_EVENT is initial.
By default, DOM-based XML documents are constructed bit by bit in the memory during sequential processing. Once processing is complete, they are available in the same ways as after the method PARSE. Troubleshooting is also similar. During sequential parsing, the document represents a valid XML document with the elements parsed up until now. If sequential parsing is ended before all elements in the input stream have been processed, the XML document represents the part of the input stream parsed up until now. The method SET_DOM_GENERATING of the parser can be used to switch the generation of the DOM representation off.
7.31 | 7.40 | 7.54
- A parsing event is an iterator concept and not an event raised by
EVENTSin ABAP Objects.
- If the caller does not register any events before PARSE_EVENT is called, PARSE_EVENT works like PARSE.
- The sequential parsing shown here is not a variant of SAX (Simple API for XML). Callback methods are not called when an event occurs.