RFML is just some XML which can be used anywhere not only in Java (though the JTOpen project has some special support for RFML).
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/rzahh/rfmlmain.htm
RFML just describes a record structure. And the structure doesn't have to be flat at all. Any structure can have substructures.
We are using it here in a framework to communicate between Java and RPG. A service program takes a map and a RFML file to write out data. Parsing the file is definitly costly and I would store the RFML structure in memory for processing using the XML Toolkit.
RFML supports all data types you need for json (except boolean and null, but there is probably an easy workaround).
Mihael
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Aaron Bartell
Sent: Tuesday, July 20, 2010 5:05 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Convert DS/Record to JSON
Hi Mihael,
Would that require Java be involved at runtime? I vaguely recall RFML being
part of the IBM Java Toolbox.
Your statement gave me an idea that builds on your thought process. What if
we parsed an externally described data structure (i.e. DB2 table) and stored
the metadata in another DB2 table that could be easily accessed and cached
in memory for subsequent reference from the RPGUI program that needed to
generate JSON. The reason for storing the meta data would be to save on
parsing each time, but if it cost just as much to parse as to go to the meta
data DB2 table then it would be a moot point.
Aaron Bartell
http://mowyourlawn.com
http://mowyourlawn.com/blog/
On Tue, Jul 20, 2010 at 9:37 AM, Schmidt, Mihael <Mihael.Schmidt@xxxxxxxxxxx
wrote:
One possibility I see is that I extend the RPG Next Gen Editor to create an
RFML file from a data structure and then that RFML file could be used to
convert from the data structure to a json object and back.
As an Amazon Associate we earn from qualifying purchases.