|
On Nov 4, 2015, at 1:58 PM, Richard Schoen <Richard.Schoen@xxxxxxxxxxxxxxx> wrote:
Jon,
You are probably correct that he can't get an XML fragment, but he can parse the XML and then re-compose his own XML fragment.
That's where XML-SAX would work nicely.
I have an XML ripper command I wrote based on some of your early XML-SAX examples. The command is called XMLREAD and it parses any XML file into named value pairs using XML-SAX.
After that I can process the data any way I need to including re-composing new XML.
Seems to be this might work nicely.
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: 3
date: Wed, 4 Nov 2015 09:34:37 -0500
from: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
subject: Re: Special Parsing Using XML-INTO
Doesn?t help.
XML-SAX will break out the components (element name and element data) just the same as XML-INTO does. Only difference is it does it one field at a time. Not helpful for the OP.
I can think of a risky non-guaranteed strategy where XML-SAX might help - but it relies on the compiler internals remaining consistent and I certainly wouldn?t want to base production code on it - a one-time routine maybe.
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.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
--
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.