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



FWIW, I have used (and, for a while, helped to develop, RPG-XML) and I can
thoroughly recommend it, especially the DOM Parser functionality within it.
That being said, if you're just looking at a one-off project and really
don't think you will have any future XML processing needs, ahnd-coded XML
(a la a Scott K) might be the quickest.

On Tue, Nov 18, 2014 at 8:32 AM, Koester, Michael <mkoester@xxxxxxxxxxxxx>
wrote:

Thanks Vern (and Jon and Henrik and René).
I have indeed looked at the developerworks piece (one of the more complete
articles I've managed to find). I had not come across the white paper,
which appears to provide a lot of info that I'll need to spend some time
with and see if I can make the publishing function work for me. Thanks for
that!

To your question, "what feeds the DS?": I'm coding an sqlrpgle program
that picks the data from several relational files for the customer account
in question. That's the easy part. Getting it into XML for the web
service to send is my challenge.

Per a archived post I saw from Scott Klement where he recommended just
pounding out the XML by hand, I am rethinking (at least for the template)
what I can do with that and CGIDEV2. Henrik seems also to be saying that
brute force is required.

Just seems like this is not such an exotic situation that hasn't been
encountered at least a few times before...

Thanks for your ideas.
-Michael
~~~~~~~~~~~~
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Vernon Hamberg
Sent: Tuesday, November 18, 2014 9:29 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Writing XML from a nested DS

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@data-
east.com> 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 ...

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.