gxluLoadSchema — load a schema into the OSR generator

Description

This utility is used to load text schemas into the OSR generator. It is called once for each schema that will be processed to create an Optimized Schema Representation.

Performance Implications

There are no performance implications.

Syntax

int gxluLoadSchema(void * oima_p,
                   char * schema_resource_p,                  
                   int *  rc_p,
                   int * rsn_p)

Parameters

oima_p
Supplied parameter
Type:
void *

A pointer to an OSR generator Instance Memory Area (OIMA).

schema_resource_p
Supplied parameter
Type:
char *
A pointer to the schema resource to process. This parameter must contain a NULL terminated, IBM-1047 text string representing one of the following:
  • The pathname of a file in the z/OS® UNIX file system containing the schema in text form.
  • URI specifying the location of the schema text to load. URIs are indicated by a scheme name, followed by a colon, followed by a relative URI reference. See RFC 3986 (http://tools.ietf.org/html/rfc3986) for a complete description of URIs.
Whether the resource passed is a URI or a pathname to a file, the name must represent an absolute path. Relative paths cannot be processed.
rc_p
Returned parameter
Type:
int *

A pointer to an area where the utility stores the return code.

rsn_p
Returned parameter
Type:
int *

A pointer to an area where the utility 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 Value:

The value returned by this service is return code (see below).

Return and Reason Codes:

On return from a call to this utility, 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

#include <stdlib.h>
#include <stdio.h>
#include <gxlhosrg.h>
#include <gxlhxec.h>

void *        oima_p;
unsigned long oima_l;
char          handler_parms[128];
char   schema_uri[URI_LEN] = “file:///u/user01/myschema.xsd”;
int           rc, rsn;

if (oima_p = malloc(GXLHXEC_MIN_OIMA_SIZE))
      { /* oima malloc succeeded   */
         oima_l = GXLHXEC_MIN_OIMA_SIZE;

        gxluInitOSRG(oima_p, oima_l,
                      0,
                     (void *)handler_parms,
                      &rc, &rsn);
    }  /* oima malloc succeeded   */

/* Now perform operations using the generator instance. */
if ((oima_p > 0) && (rc == GXLHXRC_SUCCESS))
    {  /* generator initialized */

       gxluLoadSchema(oima_p,
                      schema_uri,
                      &rc, &rsn);

        if (rc == GXLHXRC_SUCCESS)
        {/* schema load succeeded   */

 /*generate an OSR from the loaded schema*/
      
     
    ...
    }  /* schema load succeeded   */
    
   ...
   } /* generator initialized */ 

Usage notes

Call this service iteratively to load one or more schemas that will be processed to create an OSR. Once a schema has been loaded, the schema text buffer specified by the schema_resource_p parameter may be re-used for other purposes.