I do favor using XMLTABLE - still, to Dave - there are 2 ways to run XML-INTO - the 2nd uses a "handler" procedure that includes an array, and the handler is called repeatedly until all elements are "handled".

Here is a link to an article about doing this - https://www.ibm.com/docs/en/i/7.4?topic=codes-xml-into-parse-xml-document-into-variable

XMLTABLE is, IMHO, more flexible than XML-INTO - for one thing, it lets you "flatten" XML content from multiple levels without including everything else from those levels.

Cheers
Vern

On 9/2/2024 12:25 PM, Daniel Gross wrote:
Am 02.09.2024 um 18:34 schrieb Mihael Schmidt <mihael@xxxxxxxxxxxxxx>:

If it is clear that the amount of data (number of array elements) is unclear and obviously will differ much then having a fixed structure is not a good idea.

In your case why don't you use a SAX parser?
I thought long and hard, if I should answer - because my answers are nearly always "instead of this do this" and I fear, that at some point in time people might get tired of my 2 cents.

But as you - Mihael - opened up this path, here is my (strictly personal) opinion:

Especially when dealing with large amounts of data without a fixed/restricted number of elements in XML or JSON, my recommendation is SQL.

The XMLTABLE function does all the heavy lifting, and you can develop and test it interactively until the result table fits your needs.

-> https://www.ibm.com/docs/en/i/7.5?topic=functions-xmltable

You can even JOIN relational data or other XML data to your queries.

Yes - XMLTABLE looks daunting - for some even terrifying - but once you learned the basics, you can iteratively refine your query and test everything.

Maybe this might help

Kind regards,
Daniel

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.