Skip to content

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

iXML Library - Parsing to Data Objects

A token parser for parsing directly to data objects can be created as follows:

DATA(ixml)  = cl_ixml=>create( ).

...

DATA(token_parser) = ixml->create_token_parser(
                       istream        = ...
                       document       = ...
                       stream_factory = ... ).

The static type of the reference variable token_parser is then the interface IF_IXML_TOKEN_PARSER. A token parser requires the same input parameters as a normal parser and the error analysis is also the same.

However, an XML document in DOM format is not usually created. Instead, the information for the required XML data token is written directly to the ABAP data objects.

  • The method GET_NEXT_TOKEN uses iterative parsing to parse the required tokens. The method GET_NODE_INFO can be used to read the information about a parsed token to a structure of the type SIXMLNODE.
  • The method PARSE_TOKENS enters the information about the required tokens directly into the tabular attribute TOKENS of type SIXMLDOM of row type SIXMLNODE.

The parsed tokens can be specified by using the input parameter TOKEN_MASK. The information displayed can be specified using the input parameter INFO_MASK.

Other versions: 7.31 | 7.40 | 7.54


Note

By using a token renderer, it is possible to render an internal table of type SIXMLDOM (which contains the complete information for an XML document) into XML data.

Executable Examples