RXS_Validate()
This subprocedure performs validation options on a given character string.
Currently it can perform XSD validation against XML.
Subprocedure Prototype
|
|
|
Character data to be validated. |
|
This field can contain either an RXS_XsdValidationDS_t data structure, or the XSD stored in a character field. |
Example Code
*--------------------------------------------------------------
* This example code validates XML data against a specified XSD.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D XsdValidateDS...
D DS LikeDS(RXS_XsdValidationDS_t)
D Inz(*LikeDS)
D goodXml S Like(RXS_Var64Kv_t)
/free
// This example assumes that goodXml contains XML data.
// This data could be retrieved from RXS_GetStdIn(), or composed
// using the RXS composition engine.
RXS_ResetDS( XsdValidateDS : RXS_DS_TYPE_XSDVALIDATION );
XsdValidateDS.XsdLocation =
'http://files.rpg-xml.com/example/xsdvalidate/validate.xsd';
if RXS_Validate( goodXml : XsdValidateDS );
RXS_JobLog( 'XML 1 Validated successfully');
else;
RXS_JobLog( 'XML 1 Validation failed');
RXS_JobLog( 'Validation Error #%s: %s' :
%Char( XsdValidateDS.ValidationErrorCode ) :
XsdValidateDS.ValidationErrorText );
endif;
*INLR = *ON;
/end-free
Data Structures
|
|
|
|
|
Internal use only |
|
|
|
The IFS path or URI where the XSD is located. |
|
Error code returned by the validation operation. |
|
Error message returned by the validation operation. |
|
CCSID of the XSD data. |
|
Internal use only |
|
Internal use only |
|
The CCSID of the XML data. |
|
Internal use only |
|
Internal use only |
|
Internal use only |