|
On Mar 14, 2019, at 9:49 AM, Stephen Coyle <stephenfcoyle@xxxxxxxxx> wrote:
Hi All,
So I'm finally getting a chance to play with XML-INTO and I thought it was
going pretty good.
Then this came up....
In the sample below the data structure only gets populated with OrderID
9000.
OrderID 9001 gets dropped.
Not sure how to make multiple OrderID elements populate into a DS array.
It seems to me that there are multiple OrderID, Brand and Division elements
within OrderInformation.
I understand how it would be ambiguous but do not know how to structure the
DS to capture it.
Do I need to ask the XML supplier to wrap each order within their own Order
tag?
Here is the XML and RPG.
I know the XML-INTO is referencing structures and an XML path that I didn't
copy into the email...only showing the relevant bits.
Thanks in advance for any info,
- Steve
-<OrderInformation>
<OrderID>9000</OrderID>
<Brand>MyBrand</Brand>
<Division>Div100</Division>
-<InvoiceOrderItems>
-<Item Num="1">
<ItemShipDate>2019-01-16T00:00:07+00:00</ItemShipDate>
<Carrier>FEDEX</Carrier>
</Item>
-<Item Num="2">
<ItemShipDate>2019-01-16T00:00:07+00:00</ItemShipDate>
<Carrier>FEDEX</Carrier>
</Item>
</InvoiceOrderItems>
<OrderID>9001</OrderID>
<Brand>MyBrand</Brand>
<Division>Div100</Division>
-<InvoiceOrderItems>
-<Item Num="1">
<ItemShipDate>2019-01-16T00:00:07+00:00</ItemShipDate>
<Carrier>FEDEX</Carrier>
</Item>
</InvoiceOrderItems>
</OrderInformation>
Dcl-DS OrderInformation;
OrderID varchar(50) ;
Brand varchar(50) ;
Division varchar(50) ;
Dcl-DS InvoiceOrderItems;
Dcl-DS Item Dim(10);
ItemShipDate varchar(50) ;
Carrier varchar(50) ;
End-DS ;
End-DS ;
End-DS ;
XML-INTO FactoryInvoice
%Xml(%Trim(@XMLPath):
'case=any doc=file countprefix=count
path=ReceiverID/SenderID/FactoryInvoice allowextra=yes allowmissing=yes');
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
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: https://amazon.midrange.com
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.