[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conversion of XML to data structure



In V5R4, RPG comes with an op-code named XML-INTO that automatically 
maps XML data into an RPG data structure, provided that the layout is 
the same.

There's really no way to do what you ask UNLESS the functionality is 
built-in to the RPG compiler.  How else would it understand the layout 
of a data structure?  It would have to read and interpret your source 
code to do that!

Using Expat or the Expat wrapper that's in HTTPAPI, you'd have to write 
code that says "if xmlelement = 'Whatever', then move value to field 
named 'whatever'".  It's not difficult, but might be a little tedious if 
you have a lot of fields.


Frankulin, Ray wrote:
> I was just wondering if there are methods or tools available that can
> convert between data structures and XML.  The XML would be streaming
> in/out so it can't be file based.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------