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



Dutch
Are you using a handler ? Here is one I did a few weeks ago that might be of help ? ... after some help from this same forum
regards
AndyT


D idata s 160000a

D rowOITW ds qualified
D ItemCode 20A
D WhsCode 10A
D OnHand 10A
D OnOrder 10A
D IsCommited 10A

D OITWHandler pr 10i 0
D loaded 10i 0
D rowp1 likeds(rowoitw) dim(99)
D const
D count 10i 0 value

options = 'doc=string path=BOM/BO/OITW/row ' +
'allowmissing=yes allowextra=yes case=any ns=remove';
xml-into %handler( OITWhandler : loaded )
%XML(%trim(iData) : options);


P E
***********************************************************************
P OITWHandler B
D PI 10i 0
D loaded 10i 0
D rowp likeds(rowoitw) DIM(99)
D const
D count 10i 0 value
D idx s 10i 0
D itm s 15a
D oh s 15s 5
D oo s 15s 5
D cm s 15s 5
/Copy QRPGLESRC,SAPROW_H
/free
for idx = 1 to 99;
if rowp(idx).itemcode = *blanks;
leave;
endif;
itm = rowp(idx).itemcode;
if rowp(idx).onHand <> '';
oh = %int(rowp(idx).onHand);
endif;
if rowp(idx).onOrder <> '';
oo = %int(rowp(idx).onOrder);
endif;
if rowp(idx).isCommited <> '';
cm = %int(rowp(idx).isCommited);
endif;
endfor;

loaded += 1;
return 0;
/End-Free
P E

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPGLIST
Sent: 16 August 2013 15:18
To: rpg400-l@xxxxxxxxxxxx
Subject: xml-into

I've been working with the xml-into in some testing, but I don't see a clean way to handle an xml doc that has multiple fields, here is an example of what I'm talking about:

<loads>
<shipper>ACME Metal</shipper>
<consignee>Derringer Steel</consignee>
<pickups>
<pickup>Norfolk</pickup>
<pickup>Omaha</pickup>
</pickups>
</loads>

When I have multiple loading points or stop offs I need to figure out a way to handle them, without knowing up front the number of pickups or stops....

I had created a data structure to just import the data into which works for simple xml docs but not when I have elements that allow for multiples...

Suggestions?


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

CONFIDENTIALITY NOTICE: This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under law. If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you received this in error, please contact the sender and delete the material from any computer.

We have taken precautions to minimise the risk of transmitting software viruses, however, you need to carry out your own virus checks on any attachments as we can take no responsibility for any computer virus transferred by way of this email.

All views or opinions expressed will be those of the author and not necessarily those of Harry Yearsley Ltd.

Harry Yearsley Ltd, Registered 556895, Registered Office : Yearsley Group, Hareshill Road, Heywood, Lancs., OL10 2TP

Business is conducted as under our Terms and Conditions available on request

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.