Start of Content Area

Background documentationBackground documentation Interface if_ixml_parse_error  Locate the document in its SAP Library structure

The iXMLParseError interface represents errors or warnings issued by the XML parser during the parsing process.

Parse errors distinguish between several levels of severity: info, warning, error and fatalError. The level of severity for a particular parse error can be queried via getSeverity(). getSeverityText() provides a clear-text representation of the severity level which might be useful when printing the error message to the console or client application window.

Each parse error is identified by a unique error number, which can be queried via getNumber().

In addition to the error number a clear text error message is stored with each parse error, giving more user-friendly information about the error. The error text - or reason - might also contain additional hints about what exactly caused the error (e.g. if an end tag did not match a start tag, what tag names were actually causing the name clash). Use getReason() to retrieve the error's reason text.

The position in the XML input document, at which the error was detected, can be retrieved as either line (1..n) and column (1..m) information or as an offset to the document start. The methods getLine(), getColumn() and getOffset() provide access to this data.

specializes

enumerations

methods

 

 

enumeration Severity

The values of the Severity enumeration are used to differentiate the severity levels of parse error messages.

interface

if_ixml_parse_error

values

co_info = 1

This message is an information message only. Parsing was continued.

co_warning = 2

This message is a warning. Parsing was continued.

co_error = 3

This message is an error message. Parsing was stopped since e.g. the XML document was not well-formed.

co_fatal_error = 4

This message is a fatal error message. Fatal error messages are usually issued if the parser cannot continue parsing due to an internal problem.

co_severity_xxx = 5

Reserved.

abap signature

constants:

co_info type I value 1,

co_warning type I value 2,

co_error type I value 3,

co_fatal_error type I value 4,

co_severity_xxx type I value 5.

 

 

method get_column

This method returns the column number (1..m) in the XML input document at which the parse error occured.

interface

if_ixml_parse_error

return value

Returns the column number of this parse error.

abap signature

method get_column

returning

value(rval) type I.

 

 

method get_entity

This method returns the name of the entity in which this error was detected.

interface

if_ixml_parse_error

return value

Returns the entity name of this parse error.

abap signature

method get_entity

returning

value(rval) type string.

 

 

method get_line

This method returns the line number (1..n) in the XML input document at which the parse error occured.

interface

if_ixml_parse_error

return value

Returns the line number of this parse error.

abap signature

method get_line

returning

value(rval) type I.

 

 

method get_number

This method returns the unique error message number of this parse error.

interface

if_ixml_parse_error

return value

Returns the unique error message number of this parse error.

abap signature

method get_number

returning

value(rval) type I.

 

 

method get_offset

This method returns the offset (0..l) to the beginning of the XML input document at which this parse error occured.

interface

if_ixml_parse_error

return value

Returns the offset to the beginning of the XML input document of this parse error.

abap signature

method get_offset

returning

value(rval) type I.

 

 

method get_reason

This method returns a clear-text description of the reason for this parse error. Depending of the error, this description might contain additional information about what caused the error (like identifier names etc.).

interface

if_ixml_parse_error

return value

Returns the reason text of this parse error.

abap signature

method get_reason

returning

value(rval) type string.

 

 

method get_severity

This method returns the severity level of this parse error. Possible values are: info, warning, error, fatalError (see ParseError::Severity).

interface

if_ixml_parse_error

return value

Returns the severity level of this parse error.

abap signature

method get_severity

returning

value(rval) type I.

 

 

method get_severity_text

This method returns a text representation of the severity level of this parse error. Possible values are: "info", "warning", "error", "fatalError".

interface

if_ixml_parse_error

return value

Returns a string representation of the severity level of this parse error.

abap signature

method get_severity_text

returning

value(rval) type string.

 

 

method query_interface

Queries the specified interface.

interface

if_ixml_parse_error

parameters

iid

The interface ID of the interface to query.

return value

Returns a reference to the queried interface or null if no such interface is supported.

abap signature

method query_interface

importing

iid type I

returning

value(rval) type I.