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