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



that's good info, I'm concerned that I have 3 nodes at the same level of
ChangePODetail.
I have the ChangePODetail, SplitPODetail and NewPODetail - is that
possible to handle in this way?
MLR



From: Barbara Morris <bmorris@xxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Date: 01/26/2012 10:53 AM
Subject: Re: XML-INTO with %HANDLER
Sent by: rpg400-l-bounces@xxxxxxxxxxxx



On 1/26/2012 11:08 AM, MRiggins@xxxxxxxxxxxx wrote:

There are no parsing errors received using the %HANDLER. I do convert
the
XML CCSID to 1208 before running the program. If someone would be able
to
take a look and see what error I am making it would be greatly
appreciated. I have included the basic program and the XML example.

When you use %HANDLER, you get the data within the handler procedure not
in a data structure. The "path" option refers to the path within the XML
document to get to the repeating data that you want. Most likely you'd
code 'path=PO/ChangePODetail'. You'd code your handler procedure to
expect an array of LIKEDS(ChangePODetail).

I think these are the changes you need to get started.

XML-INTO %HANDLER(ProcessPO : PCount)
chg %XML(xmlfile : 'path=PO/POChanges case=any +
allowmissing=yes allowextra=yes +
doc=file');


* Handler Routine
p ProcessPO b
D PI 10i 0
D POCount 10i 0
chg D POds likeds(ChangePODetail)
D dim(2) Const
D elements 10i 0 value

D i s 10i 0

/FREE
for i to %elem(POds);
//do something;
endfor;
Return 0;
/end-free
p E


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.