SAP ABAP IXML LIB PARSE ERROR
Get Example source ABAP code based on a different SAP table
ARTICLE
If a parser detects errors in the
The static type of the reference variable
Example
The parsed
DATA(stream_factory) = ixml->create_stream_factory( ).
DATA(istream) = stream_factory->create_istream_string(
`<(><<)>text1>aaa<(><<)>/text><(><<)>text2>bbb<(><<)>/text>` ).
DATA(document) = ixml->create_document( ).
DATA(parser) = ixml->create_parser(
stream_factory = stream_factory
istream = istream
document = document ).
IF parser->parse( ) <(><<)>> ixml_mr_parser_ok.
handle_errors( ).
RETURN.
ENDIF.
...
METHOD handle_errors.
DO parser->num_errors( ) TIMES.
DATA(error) = parser->get_error( index = sy-index - 1 ).
DATA(line) = error->get_line( ).
DATA(column) = error->get_column( ).
DATA(reason) = error->get_reason( ).
...
ENDDO.
ENDMETHOD.