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



Mike


I believe there is a basic problem with your setup - the names of the data structure and its subfields must match elements and tags of the XML.


I cannot find "xmlds" anywhere in the XML, not "domain" by itself as a tag or attribute. Same for "instance".


Seems you need a data structure named "GPCodedValueDomain2" with subfields "DomainName", "FieldType", "MergePolicy", and "SplitPolicy". And a nested data structure subfield named "CodedValues" that is a LIKEDS of one with an array with "CodedValue" and "Code" in it somehow - this is murky and I'm not going to take time to work it out.


HTH

Vern


On 5/25/2016 9:05 AM, Smith, Mike wrote:
I had it as
XML-INTO xmlds %XML( esrids: 'case=any');
But changed it as you suggested but still get the same error.

D ESRIDS ds
D XML 32767A varying

D xmlds ds dim(200) qualified
D domain 50A
D instance 50A


XML-INTO xmlds %XML( esrids: 'doc=string');



-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Wednesday, May 25, 2016 9:57 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: XML processing from a field

Looking at the docs....

Assuming your XML character variable is named XMLDATA, you should have

xml-into output %XML(xmldata : 'doc=string');

Charles

On Wed, May 25, 2016 at 9:42 AM, Smith, Mike <Mike_Smith@xxxxxxxxxxxxxxxx>
wrote:

I have never had occasion to process xml before, so this is completely
new to me. I don't think that the way I'm being asked to get and
parse the data is the norm.
I found an article http://www.itjungle.com/fhg/fhg080415-story01.html
example (XMLINTOB1) that has code that appears to do something
similar to I what I want to do, but I'm not having any luck.

I am reading a file on SQL SERVER from an ESRI table.
It appears that there is a field that contains XML data.
I have read the file and loaded the data into a character field.

When I run the XML-INTO I get an error code of 302 which says that the
xml document was not an external file. Which of course its not.

Below is a snippet of data . I'm not sure if it is the complete
contents of the field, but hopefully it is enough to indicate what I'm looking at.
<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>Pipe Casing
Reason</DomainName><FieldType>esriFieldTypeString</FieldType><MergePol
icy>esriMPTDefaultValue</MergePolicy><SplitPolicy>esriSPTDuplicate</Sp
litPolicy><Description
/><Owner>DBO</Owner><CodedValues
xsi:type="typens:ArrayOfCodedValue"><CodedValue
xsi:type="typens:CodedValue"><Name>Highway</Name><Code
xsi:type="xs:string">Highway</Code></CodedValue><CodedValue
xsi:type="typens:CodedValue"><Name>Railroad</Name><Code
xsi:type="xs:string">Railroad</Code></CodedValue><CodedValue
xsi:type="typens:CodedValue"><Name>Street</Name><Code
xsi:type="xs:string">Street</Code></CodedValue><CodedValue
xsi:type="typens:CodedValue"><Name>Water</Name><Code
xsi:type="xs:string">Water</Code></CodedValue></CodedValues></GPCodedV
alueDomain2>


Can I process the xml from a field? If so, what is causing the 302
error?
Any guidance on how to accomplish this is appreciated.


Mike

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.
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(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.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (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.

Please contact support@xxxxxxxxxxxx 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.