|
Hi Peter,http://archive.midrange.com/rpg400-l.
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>
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.