|
On Aug 27, 2018, at 12:40 PM, Justin Taylor <JUSTIN@xxxxxxxxxxxxx> wrote:
Right now, it does this:
Xml-into€ gOutput.products %xml(fullFilePath :’doc=file path=topLevel/products/product allowextra=yes’);
Xml-into€ gOutput.Stages %xml(fullFilePath :’doc=file path=topLevel/ Stages / Stage allowextra=yes’);
Xml-into€ gOutput.productsToLoad %xml(fullFilePath :’doc=file path=topLevel/ productsToLoad/productToLoad allowextra=yes’);
Xml-into€ gOutput.loadedContainers %xml(fullFilePath :’doc=file path=topLevel/ loadedContainers/loadedContainer allowextra=yes’);
Xml-into€ gOutput.unloadedProducts %xml(fullFilePath :’doc=file path=topLevel/ unloadedProducts/unloadedProduct allowextra=yes’);
It seems to me (maybe wrong) that it's parsing the same XML file multiple times. The code just wants to load the applicable XML into the gOutput data structure.
When I try this statement, it fails, not sure why it's converting my error extender to that character (? Euro ?):
Xml-into€ gOutput %xml(fullFilePath :’doc=file allowextra=yes’);
RNX0353
The XML document does not match the RPG variable; reason code 1.
Cause . . . . . : While parsing an XML document, the parser found that the XML document does not correspond to RPG variable "goutput" and the options do not allow for this. The reason code is 1. The exact subfield for which the error was detected is "goutput".
-----Original Message-----
From: Jon Paris [mailto:jon.paris@xxxxxxxxxxxxxx]
Sent: Monday, August 27, 2018 11:10 AM
To: Rpg400 Rpg400-L <rpg400-l@xxxxxxxxxxxx>
Subject: Re: XML-INTO & path
Doesn't look that tough Justin. Why do you need path at all if going after the top level?
Also can you explain what "multiple calls" you are currently doing.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
On Aug 27, 2018, at 10:34 AM, Justin Taylor <JUSTIN@xxxxxxxxxxxxx> wrote:
I have an existing RPG *SRVPGM that pulls an XML document into a data structure. It makes multiple XML-INTO calls, and I’m wondering if I can accomplish it with a single XML-INTO (or if I’ll need to use XML-SAX). It’s currently using the path parameter on XML-INTO to navigate down two levels. I tried to point it at the top level, but that failed.
XML snippet:
<topLevel>
<products>
<product … />
<product …/>
<products>
<loads>
<load …/>
<load …/>
<loads>
<stages>
<stage …/>
<stage …/>
<stages>
{pattern repeats}
</topLevel>
Data structure:
Dcl-ds gOutputDs qualified inz ;
Products likeDs() dim() ;
Stages likeDs() dim() ;
productsToLoad likeDs() dim() ;
loadedContainers likeDs() dim() ;
unloadedProducts likeDs() dim();
End-ds;
RPG (current snippet):
Xml-into€ gOutput.products %xml(fullFilePath :’doc=file
path=topLevel/products/product allowextra=yes’);
I was hoping I could find the correct “path”, but so far the RPG docs & Google have failed me.
TIA
--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
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: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.