|
wrote:
IBM i 6.1.
I have a XML document on the IFS. CCSID is 1208.
A cut-down version of the file may be...
<?xml version="1.0" encoding="UTF-8"?> <PURCHASEORDER> <HEADER>
<HEADERNOTES> </HEADERNOTES> </HEADER> </PURCHASEORDER>
...this structure is defined as follows...
<PURCHASEORDER> <HEADER> <HEADERNOTES> <POHDRNOTE></POHDRNOTE>
</HEADERNOTES> </HEADER> </PURCHASEORDER>
In the RPGLE, this is defined as follows: -
D PO DS Qualified Inz
D Dim( POIdxMax )
D Header...
D LikeDS( Header_t )
D Header_t...
D DS Qualified
D Based( Template )
D HeaderNotes...
D LikeDS( HeaderNotes_t )
D HeaderNotes_t...
D DS Qualified
D Based( Template )
D POHdrNote...
D 50c Inz
D Dim( POHdrNteIdxMax )
read as follows...
options = 'doc=file + path=Update/member/PurchaseOrder
+ case=any + allowextra=yes
+ allowmissing=yes';
xml-into PO %xml( xmlfile : options );
When the POHdrNote data is not present in the XML, I expect the
PO(x).Header.HeaderNotes.POHdrNote(x) data field to contain blanks.
However, when I look at the hex values of the field in debug, the hex
value is all 40s (I would expect hex values of all 20s for unicode ?).
When I test in the program whether the data is *Blank, the test gives me
the wrong result.
Why am I getting hex value of 40s rather than 20s when the data tags are
missing from the XML ?
Thanks.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.