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



Since it is apparently inconsistent, you should report it to IBM.

It should behave the same way for < tag > </tag> and < tag />


On Mar 4, 2020, at 8:15 AM, Maria Lucia Stoppa <mlstoppa@xxxxxxxxx> wrote:

I know this is a good practice and I usually act that way.
But this time, given that when the tag is not self-close it correctly gets
0 for blank, I thought data can be extracted as per their type whether the
tag's close.
What's important is that now I know what to do.
Thank you

Il giorno mer 4 mar 2020 alle ore 14:25 Jon Paris <jon.paris@xxxxxxxxxxxxxx>
ha scritto:

In the early days IBM used to recommend using character fields and doing
your own validation in cases where you had no control and/or doubts about
the quality of supposed numeric data.

But it will be really good for them to get the specific issue that you
encountered fixed. Blanks or a null string really should equate to zero in
my opinion.


On Mar 4, 2020, at 2:00 AM, Maria Lucia Stoppa <mlstoppa@xxxxxxxxx>
wrote:

I am grateful for the new things I have learned today.

Yes, error code 105 was in message details, but I couldn't discover the
meaning. Also, I didn't know about %status function. You are right, I
should have, I'll llok for it in the reference.

Generally speaking, using character fields when working with xml data
from
other sources may be less frustrating.

Thank you very much.

Il giorno mer 4 mar 2020 alle ore 00:36 Jon Paris <
jon.paris@xxxxxxxxxxxxxx>
ha scritto:

I ran a version of your code and the job log shows that the error was
RPG
status 105 - which means
Invalid characters in character to numeric conversion functions.

So the parser is returning a value that cannot be converted to a number.
In this case the parser is retuning a space and %Dec (which is
effectively
being used under the covers) cannot convert blanks to zero. IBM have
been
asked to change this but for now we are stuck with it.

Had you looked at %Status - which you should always do when you code the
(E) extender - you would have seen the error.


On Mar 3, 2020, at 4:35 AM, Maria Lucia Stoppa <mlstoppa@xxxxxxxxx>
wrote:

Hello,
I am successfully using xml-into in many applications, but sometimes
the
XML answer of a web service is like this:

<?xml version="1.0" encoding="utf-8"?>
<InfoLabel>
<Parcel>
<SiglaMittente>E3</SiglaMittente>
<NumeroSpedizione>800000009</NumeroSpedizione>
<TotaleColli>11</TotaleColli>
<TipoCollo />
<SiglaSedeDestino />
<DenominazioneMittente>GLS BOLOGNA</DenominazioneMittente>
<DenominazioneDestinatario>PROVA ETICHETTE</DenominazioneDestinatario>
<IndirizzoDestinatario>VIA DEL FONDITORE 2/7</IndirizzoDestinatario>
<CittaDestinatario>MILANO</CittaDestinatario>
<ProvinciaDestinatario>MI</ProvinciaDestinatario>
<DataSpedizione>03/03/20</DataSpedizione>
<DescrizioneSedeDestino>GLS Check</DescrizioneSedeDestino>
...other xml data..
</Parcel>
<Parcel>
...other xml data..
</Parcel>
</InfoLabel>

where the difference is the presence of self-closing tags
(likeTipoCollo
in
the example). Other web services usually return both opening and
closing
tags with a blank inside.

When xml-into is executed it breaks with this error:
RNX0353 - The XML document does not match the RPG variable; reason code
8.
where
8. The XML document contains data that cannot be successfully assigned
to
the RPG variable. The RPG status code associated with the failure is
105. The
exact subfield for which the error was detected is
"infolabel.parcel(1).tipocollo"

The data structure is defined like this:
dcl-ds DsInfoLabel qualified inz;
SiglaMittente char(2) inz;
NumeroSpedizione zoned(9: 0) inz;
TotaleColli zoned(2: 0) inz;
TipoCollo zoned(1: 0) inz;
SiglaSedeDestino char(4) inz;
... other fields...
end-ds;
dcl-ds InfoLabel qualified inz;
NumParcel int(10) inz;
Parcel likeds(DsInfoLabel) dim(99);
end-ds;

This is the operation code:
xml-into(e) InfoLabel %xml(resmsg_DATA: xmlopts);
where
xmlopts='doc=string trim=all case=any allowmissing=yes allowextra=yes
path=InfoLabel countprefix=Num'

As far as I know, there isn't any other option that can be set to avoid
this situation.
Also, this web service must be used as-is.
Is there something else I can do??

Thank you


--

Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
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

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



--

Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
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

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



--

Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
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 thread ...

Replies:

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.