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



Look at the datasubf option of the XML-INTO op code.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----"Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
From: "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx>
Date: 06/29/2016 10:49AM
Subject: RE: XML processing from a field


Well, I've finally got a chance to work on this again and I think I'm very close. I think I'm failing on the last value(code) in my data structure, but not sure why.

Here is the xml document :
<GPCodedValueDomain2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:typens="http://www.esri.com/schemas/ArcGIS/10.1"; xsi:type="typens:GPCodedValueDomain2">
<DomainName>Yes No Indicator</DomainName>
<FieldType>esriFieldTypeString</FieldType>
<MergePolicy>esriMPTDefaultValue</MergePolicy>
<SplitPolicy>esriSPTDuplicate</SplitPolicy>
<Description />
<Owner>DBO</Owner>
<CodedValues xsi:type="typens:ArrayOfCodedValue">
<CodedValue xsi:type="typens:CodedValue">
<Name>No</Name>
<Code xsi:type="xs:string">N</Code>
</CodedValue>
<CodedValue xsi:type="typens:CodedValue">
<Name>Yes</Name>
<Code xsi:type="xs:string">Y</Code>
</CodedValue>
</CodedValues>
</GPCodedValueDomain2>

I pick up everything until the 'N' in the <Code> then I get an error.
The XML document does not match the RPG variable; reason code 6.

Data structures are setup as follows.
D GPCODEDVALUEDOMAIN2...
D ds qualified
D domainname 50A
D fieldtype 50A
D mergepolicy 50A
D splitpolicy 50A
D description 50A
D owner 10A
D codedvalues LikeDS(val_T)

* this is the coded values datastructure
D val_T ds Template qualified
D xsi_type 50A
d codedvalue LikeDS(cod_T) Dim(5)

* this is the codedvalue datastructure
D cod_T ds Template qualified
D xsi_type 50A
D name 50A
D code LikeDs(codexsi_t)

D codexsi_t ds Template qualified
D xsi_type 50A
D code 50A This field doesn't populate



I appreciate the help
for any subscription related questions.
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.

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