gxlpParse — parse a buffer of XML text

Description

The gxlpParse callable service parses a buffer of XML text and places the result in an output buffer.

Performance Implications

Ideal performance will be obtained when the PIMA is sufficiently large to contain all the needed data structures, and the input and output buffers are large enough to process the entire XML document. During the parsing process, the z/OS XML parser constructs persistent information in the PIMA that can be reused within a parse instance. If the caller is going to process multiple documents that contain similar sets of symbols (namespaces and local element and attribute names in particular), then reusing the PIMA will improve performance during the processing of subsequent documents. If this behavior is not required, the PIMA should be cleaned up by calling the termination service and reinitialized by calling the initialization service before using the PIMA for another parse request.

Syntax

int gxlpParse(void * PIMA,
              int * option_flags,
              void ** input_buffer_addr,
              long * input_buffer_bytes_left,
              void ** output_buffer_addr,
              long * output_buffer_bytes_left,
              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.

option_flags
Supplied parameter
Type:
int *

This parameter must point to a word with the value 0.

input_buffer_addr
Supplied and returned parameter
Type:
void **

The name of the area that contains the address of the buffer with the XML text to parse. The z/OS XML parser updates this parameter to provide important return information when control returns to the caller. See the Usage notes for details.

input_buffer_bytes_left
Supplied and returned parameter
Type:
long *

The name of the area that contains the number of bytes in the input buffer that have not yet been processed. The z/OS XML parser updates this parameter to provide important return information when control returns to the caller. See the Usage notes for details.

output_buffer_addr
Supplied and returned parameter
Type:
void **

The name of the area that contains the address of the buffer where the z/OS XML parser should place the parsed data stream. The z/OS XML parser updates this parameter to provide important return information when control returns to the caller. See the Usage notes for details.

output_buffer_bytes_left
Supplied and returned parameter
Type:
long *

The name of the area that contains the number of available bytes in the output buffer. When the z/OS XML parser returns control to the caller, this parameter will be updated to indicate the number of unused bytes in the output buffer. This buffer must always contain at least a minimum number of bytes as defined by the GXLHXEC_MIN_OUTBUF_SIZE constant, declared in header file gxlhxec.h. This service will validate the length of this area against this minimum length value.

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.

Return and Reason Codes:

On return from a call to this service, register 15 will contain the return code. The return and reason code are both also set as output parameters. The value of the reason code is undefined when the return code has no associated reasons. Return and reason codes are defined in the header file gxlhxr.h (see gxlhxr.h (GXLYXR) - defines the return codes and reason codes). For reason code descriptions, also see Reason codes listed by value.

Example

void * PIMA;

int * option_flags;

void * input_buffer_addr; long input_buffer_bytes_left;

void * output_buffer_addr; long output_buffer_bytes_left;

int rc, rsn;

gxlpParse(PIMA,
           option_flags,
           &input_buffer_addr, &input_buffer_bytes_left,
           &output_buffer_addr, &output_buffer_bytes_left,
           &rc, &rsn);

Usage notes

This callable service is a direct map to GXL1PRS (GXL4PRS). Refer to Usage notes of GXL1PRS (GXL4PRS) for usage information.