×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




You have two problems here.

As Vern has pointed out there are namespaces being used which you are not handling. In this case adding the option ns=remove will handle that.

But the specific problem you described is caused by an incorrect data definition. Elements such as AverageDailyBalance that contain an attribute such as nil="true" require that they be defined as a DS as "nil" is a child of AverageDailyBalance. But you also seem to expect the element to sometimes contain a value so you also need to add the datasubf option. I have assumed datasubf=data in the minimum definition shown here: Changes in bold spacing probably not accurate.

dcl-ds Balance qualified;
Type varchar(50);
OpeningBalance zoned(24:4) inz(0);
ClosingBalance zoned(24:4) inz(0);
dcl-ds AverageDailyBalance;
nil char(4);
data zoned(24:4) inz(0);
end-ds;
dcl-ds AnnulPercentageYield;
nil char(4);
data zoned(24:4) inz(0);
end-ds;
BalanceAsOf varchar(50);
End-Ds Balance;

A word of advice - don't use allowextra=yes and allowmissing=yes unless you actually need them. Particularly when testing they will tend to mask the real problems as I suspect they did here.


Jon P.

P.S. I'm going to ignore Vern's outrageous remarks about SQL <grin>

On Mar 9, 2023, at 5:11 PM, K Crawford <kscx3ksc@xxxxxxxxx> wrote:

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.
--
KCrawford
--
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@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.