|
The name of the Parse Instance Memory Area (PIMA) which has been previously initialized with a call to the initialization service.
The name of the parameter containing an integer value initialized to GXLHXEC_CTL_FRAGMENT_PARSE.
This parameter must contain a pointer to where the service will locate the address of the document fragment parsing structure, which is mapped by the header gxlhctl.h. The name of the data structure is GXLHXFP. This structure allows the caller to specify whether to enable or disable document fragment parsing through the XFP_FLAGS_FRAGMENT_MODE bit set in the XFP_FLAGS field. Document fragment parsing is disabled by default.
The XFP_XD_PTR is where the service will store the address of the diagnostic area, which is mapped by macro GXLYXD. This provides additional information that can be used to debug problems in data passed to the z/OS XML parser. The diagnostic area resides within the PIMA, and will be overlaid on the next call to the z/OS XML parser.
The name of the area where the service stores the return code.
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.
void * PIMA
void * fragContext;
void * fragParse;
void * ctl_data_p;
int * option_flags;
void * fragbuf; int fragbuf_left;
void * outbuf; int outbuf_left;
GXLHXFP xfp;
GXLHXFC xfc;
GXLHXFC_ENTRY xfc_entry[1];
char * nspfx_str; char * nsuri_str;
char * fragPath;
int rc, rsn;
/* Perform necessary setup */
nspfx_str = "ibm";
nsuri_str = "http://w3.ibm.com";
fragPath = "/ibm:root/ibm:person";
/* Perform a reset */
gxlpControl(PIMA,
GXLHXEC_CTL_FIN,
&ctl_data_p,
rc,
rsn);
/* setup the GXLHXFC structure with namespace binding information */
memset(&xfc,0,sizeof(GXLHXFC));
xfc.XFC_ENTRY_NSCOUNT = 1;
xfc_entry[0].XFC_ENTRY_NSPFX_LEN = strlen(nspfx_str);
xfc_entry[0].XFC_ENTRY_NSPFX_PTR = nspfx_str;
xfc_entry[0].XFC_ENTRY_NSURI_LEN = strlen(nsuri_str);
xfc_entry[0].XFC_ENTRY_NSURI_PTR = nsuri_str;
xfc.XFC_ENTRY_NS_PTR = &xfc_entry
xfc.XFC_FRAGPATH_PTR = fragPath;
xfc.XFC_FRAGPATH_LEN = strlen(fragPath);
fragContext = (void*)&xfc
/* initialize the GXLHXFP structure with zero and set the enable flag */
memset(&xfp,0,sizeof(GXLHXFP));
xfp.XFP_FLAGS = XFP_FLAGS_FRAGMENT_MODE;
fragParse = (void*)&xfp
/* Load the fragment parsing contexts */
gxlpControl(PIMA,
GXLHXEC_CTL_LOAD_FRAG_CONTEXT,
&fragContext,
rc,
rsn);
/* Note: the OSR must be loaded at this point */
/* Enable document fragment parsing */
gxlpControl(PIMA,
GXLHXEC_CTL_FRAGMENT_PARSE,
&fragParse,
&rc,
&rsn);
/* Parse the desired document fragments */
gxlpParse(PIMA,
option_flags,
&fragbuf,
&fragbuf_left,
&outbuf,
&outbuf_left,
&rc,
&rsn);
/* Disable document fragment parsing */
xfp.XFP_FLAGS = 0;
gxlpControl(PIMA,
GXLHXEC_CTL_FRAGMENT_PARSE,
&fragParse,
&rc,
&rsn);