
The “fastest, easiest” way is probably not the way to do it. Do it the “right” way instead.
XML is stored in whatever way you choose to store it. Asking how it’s stored is like asking how a programmer’s name is stored. It could be stored in a data area or in a column in a table or in a user space or as a constant in a program or…
XML should be stored as an XML file, or, if you have the DB2 XML Extender product, as part of a DB2 table.
What version of i5/OS do you have? What DB2 options are available for you? Are you restricted to RPG programming or would you be comfortable with some COBOL or Java?
Tom

Tom,
I would like to know how this can be done using RPG/ILE RPG.
It would be helpfull for my understanding
Thanks

Hi,
Please do check out this http://www.scottklement.com/expat/
and you will be able to do what you want with XML
YuVa47

I would like to know how this can be done using RPG/ILE RPG.
It would be helpfull for my understanding
Yes, but a decent answer requires knowing what version/release of i5/OS you are running. Also, if you have the DB2 Extender product installed, you might store and handle XML very differently than if you don’t. And if you have the XML Toolkit installed, some coding will be easier than if you don’t.
COBOL had some native XML support built into the compiler before RPG did. You asked for “easiest, fastest”, and COBOL could be easier and faster depending on what you have available.
Use GO LICPGM and take option 10=Display installed licensed programs. Scan down the list to see if anything references XML, and report results.
YuVa47 suggested Scott Klement’s Xpat tool, and it’s an excellent tool to have available. Whether it works for you or not, or whether you’re allowed to use it or not, knowing what you have in your system will be necessary.
Tom

I use EXPAT, and find it easy to use. I have sample programs in RPG showing the processes involved.
Unless you are just dumping incoming XML into a flat file, or using the DB2 XML extensions (which will still require some programming), you will either have to use a mapping tool, which is expensive, or write your own code. EXPAT does make things a lot simpler than using the built-in XML functions in RPG - although I can’t comment about COBOL.
The ‘right’ way, as Tom would say, is to receive the incoming XML and store it in the database you have. If it is not an XML database, there is no point in creating an XML database just to store your XML data. You work with what you have, which for most companies with iSeries is a relational database. EXPAT (and other products) gives you the tools to do that.
If you want some sample code, let me know. I’m on john.blenkinsop@ne.nykline.com
Sloopy


















