Functionality was added to z/OS XML System Services in z/OS® 1.12 that is available in z/OS 1.10 and z/OS 1.11 with APAR OA32251; PTFs UA59081 and UA59082. This APAR includes support for schema discovery, parsing of XML document fragments and restrict root support.
Schema discovery enhances the usability of the validating parser by allowing the caller to query the XML document schema locations detailed in the “schemaLocation” and “noNamespaceSchemaLocation” attributes, in addition to the root element namespace and local name. Following this, the caller will have the opportunity to load an OSR without having to reset the parse. See Obtaining information on schema locationsfor more information on schema discovery support.
Parsing of document fragments without obtaining and parsing an entire document is now supported when parsing in z/OS XML System Services with schema validation. . See Parsing XML document fragments with validationfor more information on fragment parsing.
Restrict root support allows an z/OS XML System Services caller to restrict the root name against a given root element name or a list of root element names when performing a validating parse. See Restricting the root element namefor more information on restrict root support.
To enable the support in z/OS 1.10 and z/OS 1.11 environments, the caller must complete the following steps:
int f_code = GXLHXEC_LOD_VPARSE_ALT;
int f_data = 0;
int lodRet = 0;
int lodRsn = 0;
/* load the alternalte parser */
gxlpLoad(f_code,
f_data,
&lodRet,
&lodRsn);
xsdosrg -a -o test.osr test.xsd
void * myOIMA = NULL; /* OSR generator instance memory area */
long myOIMALength = GXLHXEC_MIN_OIMA_SIZE; /* length of OIMA */
void * sysSvcWorkarea = NULL;
featureFlags = GXLHXEC_OSR_ALT; /* Alternate OSR requested */
int localRC = 0;
int localRSN = 0;
myOIMA = malloc(GXLHXEC_MIN_OIMA_SIZE);
localRetVal = gxluInitOSRG(myOIMA,
myOIMALength,
featureFlags,
sysSvcWorkarea,
&localRC,
&localRSN);
/* When issuing newOSRGenerator, specify type =
gxlOSRGenerator(gxlOSRGenerator.OSRINI_ALT) */
/* This will tell subsequent calls to generate an alternate osr */
myOSRGen = gxlOSRGenerator.newOSRGenerator(gxlOSRGenerator.OSRINI_ALT);