Restricting the root element name

While performing a validating parse, the caller has the option to restrict the root element name to a list of one or more root name or namespace pairs. When selecting this option, validation is performed on the root name in the document being parsed. This option is only available for validating parses.

To enable this option, during the parse step the caller must perform a control call (gxlpControl) with the control option GXLHXEC_CTL_RESTRICT_ROOT prior to parsing the document to indicate that the root name is to be validated. The caller must also pass along a data area in the format of GXLHXRR, which contains the list of root names. Failing to do this will cause an error, resulting in the z/OS XML parser needing to be reset using CTL_FIN. The root names are specified by a local name (root name) and an optional URI for the root namespace. The strings passed in to the control call (gxlpControl) call must be in the encoding of the z/OS XML parser configured at initialization time.

The control call (gxlpControl) prepares the z/OS XML parser for a new document, but the current feature set is preserved. Subsequent resets (such as CTL_FEAT) will not change the current settings of the restrict root element control call. These settings will still apply when parsing subsequent documents.

The information produced in the output buffer from the subsequent parse does not change when using this option.

The caller can remove the restriction on the root element name by calling gxlpControl () with the control option GXLHXEC_CTL_RESTRICT_ROOT and setting the XRR_ENTRY_COUNT value to '0' in the GXLHXRR data area.

The following is an example call sequence:
gxlpLoad
gxlpInit
gxlpControl(GXLHXEC_CTL_LOAD_OSR)
gxlpControl(GXLHXEC_CTL_RESTRICT_ROOT,GXLHXRR)
gxlpParse
gxlpTerminate