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



Jon,

so you are saying that XML-INTO can't create a trunk of elements that is
within a
parent element ?

On Fri, May 6, 2011 at 6:20 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:


On May 6, 2011, at 11:44 AM, rpg400-l-request@xxxxxxxxxxxx wrote:

This is more for my information that anything else. Because I am at V6R1
I
could declare a huge variable and do an XM-INTO to extract it. My
understanding was that the handler would break it down into smaller
pieces
but it didn't do it.

Using XML-INTO with a handler does not change the RPG data definition
requirements. You still define everything the same way as you would if you
weren't using a handler. For example if the XML looks like this:

<Customers>
<RecordCount> 6 </RecordCount>
<Company>Phones R Us</Company>
<Company>Suchadeal Bank</Company>
<Company>Rinky Dinky Toy Co.</Company>
<Company>Partner400</Company>
<Company>BlackHole Navigation</Company>
<Company>Banker's Trust</Company>
</Customers>

Then the basic XML-INTO would be:

d extractedData DS
d company 32a Dim(99)

/Free
XML-INTO company
%XML(XML_Input1: 'case=any' );

If using handler it would look like this: (handling in 4 "unit" chunks)

d HandleCompany pr 10i 0
d commArea 10i 0
d company 32a Dim(4) Const
d numElements 10i 0 Value


XML-INTO %Handler( HandleCompany: commArea )
%XML(XML_Data : 'path=Customers/Company case=any' );

The handler will not break the document up into arbitrary pieces - it has
to break it up into a number of repeated elements.


Jon Paris
--
This is the RPG programming on the IBM i / System i (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.