|
You wouldn't be willing to share that with the group would ya? I am always interested in anything to do with RPG and XML! :-) -----Original Message----- From: Joe Pluta [mailto:joepluta@xxxxxxxxxxxxxxxxx] Sent: Friday, September 05, 2003 12:39 PM To: 'Web Enabling the AS400 / iSeries' Subject: RE: [WEB400] Re: Re: XML, RPG, One point here: my knowledge of C/C++/Java has come in VERY useful as far as taking advantage of RPG IV. Without the experience in those languages, I doubt I would be able to make as good of use of various RPG IV features. For example, I recently wrote a basic XML parser in RPG IV in under 150 lines, using callback procedures. The prototype looks like this: p XmlRead b export d XmlRead pi d xiFile 128A varying const d pTagStart * procptr const d pTagEnd * procptr const d pAttribute * procptr const d pCDATA * procptr const d pOther * procptr const You pass it an IFS file name, and the addresses of five callback procedures. This is a SAXP type processor, where the parser spins through the XML file and calls procedures as it parses elements of the XML stream. You write the callback procedures to handle the various events. Very powerful, because the application code is separate from the parser, and you can extend the XML content without having to touch the parsing code. It's hardly full featured, and it's not a validating parser, but for well-formed documents, it FLIES. And I doubt I would have even tried to program a procedure with callbacks had I not spent a ton of time in languages like C and Java, and gotten into the philosophy of OO. Oh, and the parser is only 150 lines because it in turns calls an IFS module which encapsulates the _C_IFS APIs in another 150 lines of code. Both modules also use a common fatal error handling routine (70 lines). So not only am I using advanced programming techniques, I'm also really taking advantage of code reuse. Joe _______________________________________________ This is the Web Enabling the AS400 / iSeries (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/web400 or email: WEB400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/web400.
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.