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



The datasubf option was introduced with PTF in Release 6.1 (not sure if
there is a PTF for Release V5R4 available):

https://www.ibm.com/developerworks/mydeveloperworks/wikis/home/wiki/We13116a
562db_467e_bcd4_882013aec57a/page/Two%20new%20options%20for%20XML-INTO%20wit
h%20a%20V6R1%20PTF?lang=en


Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Peter Dow
Gesendet: Saturday, 12.1 2013 18:11
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: AW: RPGLE data structure for XML attribute and value

Thanks Birgitta. I didn't see datasubf in the v5r4 manual, and when I
compile I get

*RNF0224 30 021600 Error in %XML options at position 50,
"datasubf=data".

From
https://www.ibm.com/developerworks/mydeveloperworks/wikis/home/wiki/We13116a
562db_467e_bcd4_882013aec57a/page/Two%20new%20options%20for%20XML-INTO%20wit
h%20a%20V6R1%20PTF?lang=en

V6R1 PTF SI34938 adds two new %XML options for the XML-INTO operation,
available for programs compiled with TGTRLS(V6R1M0) or greater. To take
advantage of this enhancement, RPG programs will have to be recompiled with
PTF SI34941.

The new options are

* datasubf
* countprefix


The/datasubf/option enables the XML-INTO operation to handle XML elements in
the following form:

<tagname attr="value">text data</tagname>

and further along in that article:

*Default:*When the/datasubf/option is not specified, XML elements matching
RPG data structures cannot have text data. Text data can only be associated
with the subfields of the data structure.

I guess I'm out of luck on this one, since this customer is trying to move
off the IBM i in favor of some Windows software (AX) in order to make their
company more sellable; they're not going to upgrade beyond v5r4.

Thanks again! I can at least stop beating my head against the wall.

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx> pdow@xxxxxxxxxxxxxx
<mailto:pdow@xxxxxxxxxxxxxx>/


On 1/12/2013 2:10 AM, Birgitta Hauser wrote:
Hi Peter,



The Data Structures must be defined as follows:

D Height_T DS Qualified Template

D Reference 32A

D RefereceHeight...

D 15P 0

D Data 32A



D Centration DS

D Height LikeDS(Height_t)




Additionally you need add option datasubf=data where data is the name
of the subfields that receive the element values. Subfields with other
names will receive the attribute values

XML-INTO centration %XML(XMLstmf: 'doc=file +

ccsid=best +

case=any +

trim=all +

allowmissing=yes +

allowextra=yes +

datasubf=data');





Mit freundlichen Grüßen / Best regards



Birgitta Hauser



"Shoot for the moon, even if you miss, you'll land among the stars."
(Les
Brown)

"If you think education is expensive, try ignorance." (Derek Bok)

"What is worse than training your staff and losing them? Not training
them and keeping them!"





-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Peter Dow
Gesendet: Saturday, 12.1 2013 00:49
An: RPG programming on the AS400 / iSeries
Betreff: RPGLE data structure for XML attribute and value



This is my first time parsing an XML file. Within the XML file is the

following:



<centration>

<height reference="FAR" referenceHeight="OVERBOX">22</height>

</centration>



I'm trying to use XML-INTO (v5r4) to parse it into a data structure.
I set up the data structure like this:



d centration ds

d height likeds(height_t)



d height_t ds based(gTemplate) qualified

d reference 32a

d referenceHeight...

d 32a

d height 15p 0



And the RPG is this:



XML-INTO centration %XML(XMLstmf: 'doc=file +

ccsid=best +

case=any +

trim=all +

allowmissing=yes +

allowextra=yes');



And it runs without error and populates reference with "FAR" and
referenceHeight with "OVERBOX", but centration.height.height is blank.



How do I define this so the XML parser knows where to put the "22" value?



--

*Peter Dow* /

Dow Software Services, Inc.

909 793-9050

<mailto:petercdow@xxxxxxxxx> petercdow@xxxxxxxxx <
<mailto:petercdow@xxxxxxxxx> mailto:petercdow@xxxxxxxxx>
<mailto:pdow@xxxxxxxxxxxxxx> pdow@xxxxxxxxxxxxxx <
<mailto:pdow@xxxxxxxxxxxxxx> mailto:pdow@xxxxxxxxxxxxxx>/



--

This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email:
<mailto:RPG400-L@xxxxxxxxxxxx> RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,

visit: <http://lists.midrange.com/mailman/listinfo/rpg400-l>
http://lists.midrange.com/mailman/listinfo/rpg400-l

or email: <mailto:RPG400-L-request@xxxxxxxxxxxx>
RPG400-L-request@xxxxxxxxxxxx

Before posting, please take a moment to review the archives at
<http://archive.midrange.com/rpg400-l>
http://archive.midrange.com/rpg400-l.




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



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.