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



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');

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.