GXL1PRS (GXL4PRS) — parse a buffer of XML text

Description

The GXL1PRS 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 GXL1TRM (GXL4TRM) and reinitialized by calling GXL1INI (GXL4INI) before using the PIMA for another parse request.

Syntax

call gxl1prs,(PIMA,
             option_flags,
             input_buffer_addr,
             input_buffer_bytes_left,
             output_buffer_addr,
             output_buffer_bytes_left,
             return_code,
             reason_code)

Parameters

PIMA
Supplied parameter
Type:
Character string
Length:
Variable

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

option_flags
Supplied parameter
Type:
Integer
Length:
Fullword

Specify a word of zeroes for this parameter. In the future, this field will allow options to be compatibly added to the service.

input_buffer_addr
Supplied and returned parameter
Type:
Address
Length:
Fullword (Doubleword)

The name of a fullword (doubleword) 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 below for details.

input_buffer_bytes_left
Supplied and returned parameter
Type:
Integer
Length:
Fullword (Doubleword)

The name of a fullword (doubleword) 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:
Address
Length:
Fullword (Doubleword)

The name of a fullword (doubleword) 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:
Integer
Length:
Fullword (Doubleword)

The name of a fullword (doubleword) 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 XEC_MIN_OUTBUF_SIZE constant, declared in macro GXLYXEC. This service will validate the length of this area against this minimum length value.

return_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword where the service stores the return code.

reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword 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 macro GXLYXR. For reason code descriptions, also see Reason codes listed by value.

Example

For an AMODE 31 example using this callable service, see GXL1PRS example. For an AMODE 64 example using this callable service, see GXL4PRS example.

Usage notes