|
On Nov 4, 2015, at 8:54 AM, Richard Schoen <Richard.Schoen@xxxxxxxxxxxxxxx> wrote:
Have you looked at the XML-SAX parsing ?
You can parse and receive every element from the XML file into a variable and then process.
Then you can spin through the XML and parse off every individual field or just selected ones as needed.
You get the field name info and values.
Just be careful to anticipate duplicates with line item values.
Regards,
Richard Schoen | Director of Document Management Technologies, HelpSystems
T: + 1 952-486-6802
RJS Software Systems | A Division of HelpSystems
richard.schoen@xxxxxxxxxxxxxxx
www.rjssoftware.com
Visit me on: Twitter | LinkedIn
----------------------------------------------------------------------
message: 1
date: Tue, 3 Nov 2015 17:21:38 +0000
from: Moses Nang <moses.nang@xxxxxxxxxxxxxx>
subject: Special Parsing Using XML-INTO
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 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 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.