This looks like a namespace thing - here is a link to the support for it -
https://www.ibm.com/support/pages/xml-enhancement-namespaces-and-other-non-rpg-names
This came out around 7.2. There is an option to remove namespace prefix, it appears - so that the i: would go away - then that element has the attribute named nil and the value "true".
That's my best bet after googling around some - we don't need it here, we don't use namespaces yet in the XML we consume - besides, we tend to use SQL for reading XML files - Jon Paris "loves" SQL for XML! NOT!
Regards
Vern
On Thu, 9 Mar, 2023 at 4:13 PM, K Crawford <kscx3ksc@xxxxxxxxx> wrote:
To: rpg400-l@xxxxxxxxxxxxxxxxxx
I have a program that is using XML-INTO The XML has a null value. How do I
handle that?
I searched the archive and everything there is over 10 years old and...
This is the error I get:
The XML document does not match the RPG variable; reason code 8.
Message ID . . . . . . : RNX0353 Severity . . . . . . . : 50
Message type . . . . . : Escape
Date sent . . . . . . : 03/09/23 Time sent . . . . . . :
15:07:01
Message . . . . : The XML document does not match the RPG variable;
reason code 8.
example code:
dcl-s XmlDocument varchar(1000);
dcl-c xmlinto_options
const('case=any doc=file countprefix=ArrCnt_ +
allowmissing=yes allowextra=yes');
dcl-ds Balance;
Type varchar(50);
OpeningBalance zoned(24:4) inz(0);
ClosingBalance zoned(24:4) inz(0);
AverageDailyBalance zoned(24:4) inz(0);
AnnulPercentageYield zoned(24:4) inz(0);
BalanceAsOf varchar(50);
End-Ds Balance;
This is the line of code that the error is issued on.
xml-into GetFundedAccountStatementDetailsResponse %xml(Xmldocument:
xmlinto_options);
This is the XML:
<Balance>
<Type>Total Balance</Type>
<OpeningBalance>2904.5100</OpeningBalance>
<ClosingBalance>3854.9800</ClosingBalance>
<AverageDailyBalance i:nil="true" />
<AnnualPercentageYield i:nil="true" />
<BalanceAsOf>2023-01-31T00:00:00</BalanceAsOf>
</Balance>
Thanks for your help.
As an Amazon Associate we earn from qualifying purchases.