× 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.



You would need/want more fields like "iteration" for repeating data
segments. In the end it would operate similar to a DOM parser in that you
could then create a wrapper service program around the table that allows
statements like the following:

unqId = XMLParse('/somefile.xml');
custNum = getElemData(unqId: '/AccountDetailList/Account/Number': 1);

So you accomplished the retrieval of the XML data in two lines of code.
The unqId field is so you can relate the parsed data to a set of records
in the DB2 table that is used on all subsequent calls - almost like an IFS
handle. The third parm is stating which iteration of the "Number" you are
looking for.

There is a lot more that would need to be programmed to account for all
scenarios (I know because one of Krengel's developers just got done
writing this for our next version of RPG-XML Suite - www.rpg-xml.com :-) -
but this would work for simple XML docs.

Aaron Bartell
http://mowyourlawn.com

Adam Glauser wrote:

Aaron Bartell wrote:


Once XML data is in a more OS400/RPG/DB2 native format it
is much easier to work with IMO and would make it so no other programmer
in your shop would ever have to learn to parse XML.


This is an interesting idea, and I want to make sure I understand what
you're suggesting Aaron. Would you end up with a table with two fields,
XPath and value?

I can see where this style of processing could come in handy, though I'm
not entirely convinced that it is that much harder to write %handler()
function than it is to process the same data using XPath retrieval. I
also think that a similar level of understanding of the XML structure
(via understanding the XPath) is necessary. Does your experience
suggest otherwise?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.