GXLHXEC_CTL_ERROR_HANDLING

Description

With this control operation, the caller can do the following for a validating parse:
  • Enable the creation of auxiliary records which can include the location of an error in the XML document, the string which is in error, and also a possible expected string.
  • Enable position indexes to be present in the error location path in order to facilitate locating the error.
For a non-validating parse, it can be used to:
  • Enable the ability to continue parsing when an undefined prefix is encountered on an element or attribute. The "prefix:local name" will be treated as the local name.
  • Request an auxiliary information record that contains the tolerated return and reason codes and the error offset.

Syntax

int gxlpControl (void * PIMA,
                 int ctl_operation,
                 void * ctl_data_p,
                 int * rc_p,
                 int * rsn_p);

Parameters

PIMA
Supplied parameter
Type:
void *

The name of the Parse Instance Memory Area (PIMA) which has been previously initialized with a call to the initialization service.

ctl_operation
Supplied parameter
Type:
int

The name of the parameter containing an integer value initialized to GXLHXEC_CTL_ERROR_HANDLING.

ctl_data_p
Supplied and returned parameter
Type:
void *

This parameter contains the address of an area with information about the error string. This is the XERR data structure which is mapped by GXLHERR in the header file gxlhctl.h.

rc_p
Returned parameter
Type:
int *

The name of the area where the service stores the return code.

rsn_p
Returned parameter
Type:
int *

The name of the area where the service stores the reason code. The reason code is only relevant if the return code is not XRC_SUCCESS.

All parameters in the parameter list are required.

The enhanced error information for a validating parse is returned by way of the XERR_XD_PTR and is where the service will store the address of the diagnostic area, which is in gxlhxd.h file. The XD_LastOutput field is a pointer to the data area containing these records. This data area is within the PIMA and is formatted in the same manner as a normal output buffer.

The XEC_TOLERATED_ERROR auxiliary info record for a non-validating parse is returned in the output buffer. In the event that source offset auxiliary records are also being returned, this record will immediately follow those records for the element or attribute in the output buffer.

In addition to enabling or disabling the enhanced error features, this control option will perform a reset function. The following properties and resources will be reset by this control option:
  • Fragment mode (validating parse only)
  • Start of the XML document
  • Error state