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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.