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



Like Jon, I've looked at the SQL support for XML, including the extensive documentation that's out there - Nick Lawrence has a considerable amount of stuff out there, as I list here - I bet you've already looke, Michael!

http://www.ibm.com/developerworks/ibmi/library/i-using-rpg/

There is a list of additional resources near the bottom. And the last entry in comments by Nick have a link to a major white paper on this topic - here is the URL -

http://tinyurl.com/qduxo7m

There's a link there to the actual PDF.

Writing this is going to involve host variables with deep nesting (qualified names) - it's not clear to me that this can all be done in one statement, and there has not been array processing in SQL, anyhow - I forget, has it been added recently?

Writing this with CGIDEV2 or PowerEXT or XMLi would be simple - nested loops would be easily done in the latter 2, since they work at the node level, not necessarily the template level. So your code would more closely match the structure of the XML.

Now a question - what feeds the data structures you have? If it is file data, just go directly from that, skip the structures. Just a thought!!

I'm just asking things - I'd probably go with CGIDEV2, as that's what I'm using now and can do all I need pretty easily. But there are alternatives - I'm just not sure the XPath stuff can handle things - I believe that would be needed.

HTH
Vern

On 11/17/2014 7:15 PM, Jon Paris wrote:
I’d love to see the answer if you can find it Michael. I’ve found the syntax of the SQL/XML stuff too arcane for my limited brain.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Nov 17, 2014, at 3:57 PM, Koester, Michael <mkoester@xxxxxxxxxxxxx> wrote:

I am stretching my SQL capabilities in an attempt to write XML that reflects a data structure, but it's clear I don't really know what I'm doing.
Working in i OS 7.1 with TR7, most PTFs up-to-date (but no promises there).

All the examples (articles, archives, Knowledge Center, etc.) I've come across just deal with mapping from files, so I'm having difficulty with the data structure aspect. I am trying to create the XML for a data structure that has some nested arrays, but otherwise not too involved. Something on the order of:
d AccountData ds qualified
d Notify n
d EmailTo 50a
d BillPhones likeds(PhoneDetail) dim(32)
d nbr_Phones 3u 0 inz
d BillPDFs likeds(PDFnames)

d PhoneDetail ds qualified
d Phone 10 0 inz
d PriorPayments likeds(payments) dim(16)
d nbr_Payments 3u 0 inz

d Payments ds qualified
d Amount 8 2 inz
d PaidDate 10a

d PDFnames ds
d PDFcount 3u 0 inz
d PDFid 23a dim(25)

Tools that create XML (with basic examples) are interesting, but I've yet to see any examples of how to write XML that has nested arrays I need. I may reconsider CGIDEV2 or XMLi, over my current efforts in SQL/XML if someone can help me past this hurdle.

My end result is a payload for a web service response to a business partner.

Many thanks,
Michael Koester
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.