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



On 2019-07-12 2:05 PM, Marvin Radding wrote:
...
<OTLocation DisplayName="Location" Protocol="http" ... more attributes >
<![CDATA[2000 152748 663513 663526 810132]]>
<Value source="core">2000 152748 663513 663526 810132</Value>
</OTLocation>
... -----------------------------------------------------------------------------------
xml-into output %xml(%trim(resultxml) :
' doc=file '
+ ' datasubf=data '
+ ' case=any ' );

Marvin, your XML has more XML child elements for OTLocation following the data for OTLocation. Even with datasubf, XML-INTO doesn't support that.

The doc page about datasubf says this:

"The values for all the other subfields of the data structure must be set by attributes. Therefore, the item cannot have any child items, and the other subfields of the data structure must all be scalar subfields."

https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/rzasd/datasubfopt.htm

I made a little example similar to yours, and I found that I could get all the data if I did the XML-INTO twice, once with datasubf and then again without datasubf. I had to code allowextra and allowmissing for both.

dcl-ds ds qualified;
a char(10);
b char(10);
data char(10);
end-ds;
dcl-s theXml varchar(100);
theXml = '<ds a="aaa">'
+ 'some data'
+ '<b>bbb</b>'
+ '</ds>';
xml-into ds %xml(theXml
: 'datasubf=data allowextra=yes allowmissing=yes');
xml-into ds %xml(theXml
: 'allowextra=yes allowmissing=yes');
return;

In debug, after the first XML-INTO:
> EVAL ds
DS.A = 'aaa '
DS.B = ' '
DS.DATA = 'some data '
After the second XML-INTO:
> EVAL ds
DS.A = 'aaa '
DS.B = 'bbb '
DS.DATA = 'some data '


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.