Question

  Asked: Jun 26 2008   4:02 PM GMT
  Asked by: GLinds01


XML-INTO


XML, RPG IV, DB2

I'm trying to use XML-INTO with %XML to convert an XML document into a DB2 database file. The XML file has four levels of data with elements from each level that need to be used for the database record. Naturally, the relationships between the level are important, too. The levels are Header (control # + date), Detail (item), Quantity type (sales or inventory) & location (location + quantity).

With XML-INTO and %XML I've been able to see the data from the first three levels, but can't seem to get to the forth and still preserve the relationships between the levels; using the path option works fine, but what's the point in retrieving all the detail-level records if I can't relate those to the locations that sold them?

I've attempted to use %handler, too, but find the path option also limiting there.

Can XML-INTO handle the parsing of this complicated an XML document? If so, what am I missing?

Thanks.

Gordon

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



I have not used these RPG operation codes, but I have started evaluating an XML parser for RPG called EXPAT.

For me, it does seem to be very easy to use, and it's free. See details here:

http://www.scottklement.com/expat/

If you have problems getting the articles mentioned, try looking here:

http://systeminetwork.com/node/60993
http://systeminetwork.com/node/60999
http://systeminetwork.com/node/61002
http://systeminetwork.com/article/using-expat-xml-parser-rpg-program-part-4

I know that this is not exactly the answer you want; I'm sure that other people will be able to help you with the RPG codes, however, and maybe if you still find you are having problems then this EXPAT utility might be the answer.

Regards,

Sloopy
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Development, AS/400 and Database.

Looking for relevant Development Whitepapers? Visit the SearchWinDevelopment.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register