×
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.
* Program Entry
d PgmEntry pr extpgm('XMLCGIX2')
d *
d 10i 0
d PgmEntry pi
d pOClob *
d szOClob 10i 0
/free
clearSrvPgm();
setContent('text/html');
xmlReaderInz(pOClob:szOClob);
jsonNode('*object');
jsonNode('*boolean':'success':'true');
jsonNode('*array':'rows');
dow xmlReader = 0;
select;
when xmlGetNode = '%row';
jsonNode('*object');
when xmlGetNode = 'data' and xmlGetAttr = 'desc';
fieldName = xmlGetData;
when xmlGetNode = 'data' and xmlGetAttr = '';
if 0 <> %check('.-0123456789':xmlGetData)
or xmlGetData = '.'
or xmlGetData = '-'
or xmlGetData = '';
jsonNode('*string':fieldName:xmlGetData);
else;
jsonNode('*number':fieldName:xmlGetData);
endif;
when xmlGetNode = '/row';
jsonEndNode();
endsl;
enddo;
jsonEndNode();
jsonEndNode();
echoToClient();
return;
/end-free
If I should make a more generic solution I would probably not chose a xFMT
parameter and a fixed program name but pass a parameter with the exit
program name so I could have a number of exit programs that filter and/or
convert the result to whatever I chose without having to change the code
in XMLCGI.
As an Amazon Associate we earn from qualifying purchases.
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.