×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Hi,
a little bit late but better late than never. A little snippet on how to
validate an xml file.
**FREE
/includeQXMLDEV560/QRPGLESRC,QXML4PR560
dcl-ctrue 1;
dcl-cfalse 0;
dcl-cnull x'00';
main();
*inlr =*on;
dcl-procmain;
dcl-sfilepath char(1024);
dcl-sdomEnvData pointerinz(%addr(Qxml_DOMEXCDATA));
dcl-sparser pointer;
filepath ='/usr/local/example/xmlvalid/data.xml'+null;
// Initialize the XML environment, provide pointer to DOM exception
// data area. A call to QxmlInit must occur before any other API
// call.
QxmlInit(domEnvData);
// Create a new parser instance
parser =QxmlXercesDOMParser_new(domEnvData);
// Configure parser
QxmlXercesDOMParser_setValidationScheme(parser :Qxml_VALAU);
QxmlXercesDOMParser_setDoNamespaces(parser :true);
QxmlXercesDOMParser_setDoSchema(parser :true);
QxmlXercesDOMParser_setValidationSchemaFullChecking(parser :true);
// Parse xml file
QxmlXercesDOMParser_parse_SystemId(parser :%addr(filePath):Qxml_JOBCCSID
:0);
// Check for parse error
if(Qxml_DOMRTNCOD =Qxml_DOMNOERROR);
dsply 'valid';
else;
// message_info(Qxml_RESERVE);
dsply 'not valid';
endif;
end-proc;
I hope this helps getting you on track.
Best regards
Mihael
On 15.11.18 15:23, gio.cot via MIDRANGE-L wrote:
Hi all
I would need to validate XML with XSD; i would need to do it with RPG ; can
some one help me hot do do that ?
Thanks in advance
---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
As an Amazon Associate we earn from qualifying purchases.