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



Yes, I think the question really is why do you want to do this?

The one example where this is true is in something like Soap which has an
outer wrapper and then inside of a CTDATA it has the actual XML to be
parsed so what must happen is that you parse the wrapper to extract the
CTDATA string to another parser to that XML but in that case the XML inside
the CTDATA is just a string. In the example you give, you are just showing
regular XML. If you just wanted to process the billto data you would set a
patth to request/order_send/billto to process just that but not sure why
you want to do that.


On Tue, Nov 3, 2015 at 2:15 PM, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
wrote:

Hello,

This is not a common requirement. Normally, one program parses everything
into a data structure, then that data structure (or fields taken from it)
would be what is passed to other routines instead of the XML itself.

Or, if you really want to have different programs be responsible for
parsing different parts of the XML (which seems very unusual to me) then
you could pass the entire XML document as a string from routine to routine,
and each routine could use the PATH= option to isolate a part of the
document to parse. But, this very unusual...

I wouldn't worry about someone having already asked this question... this
is a very unusual requirement :-)

-SK


On 11/3/2015 11:21 AM, Moses Nang wrote:

Hello,

I apologize if someone has already asked this question. I have a task
where I need to parse an XML document, but part of the xml needs to be
saved to a variable and then passed along to another program that will
actually parse that part of the xml. How can I do that using XML-INTO?
So for example, in program GETCARRIER, I will parse the state element, but
I also need to pass along to another program, the order_send node, which
will parse that section.

<request>
<program>GETCARRIER</program>
<state>WI</state>
<order_send>
<billto>
<name>XYZ CORP</name>
<addr1>123 MAIN STREET</addr1>
<city>MADISON</city>
<state>WI</state>
<zipcode>53701</zipcode>
</billto>
<shipto>
<name>XYZ CORP</name>
<addr1>123 MAIN STREET</addr1>
<city>MADISON</city>
<state>WI</state>
<zipcode>53701</zipcode>
</shipto>
<itemlist>
<item>
<sku>67130</sku>
<qtyord>1</qtyord>
</item>
</itemlist>
</order_send></request>

Thanks,
Moses Nang
Integrated Merchandising Systems, LLC
847-583-7112


This email is intended only for the person or entity to which it is
addressed and may contain information that is privileged, confidential or
otherwise protected from disclosure. Dissemination, distribution or copying
of this email or the information herein by anyone other than the intended
recipient, or an employee or agent responsible for delivering the message
to the intended recipient, is prohibited. If you have received this email
in error, please immediately notify us by calling the Help Desk at (847)
583-4111.

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

Follow-Ups:
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.