I've discovered a workaround which, though not altogether pleasant, may suffice while at V5R4. At least it works for my particular xml document.
I have an existing XML-INTO which satisfactorily maps an xml element, including all nested child nodes, into a multiple dimension data structure which also has nested entries defined for each of the child nodes. Where an element has both PCDATA plus an attribute, the data structure defines only the attribute since the PCDATA is lost (without V6R1 PTF).
To obtain the missing PCDATA I perform an extra XML-INTO, whose path resolves right down to the specific element, into a variable whose array dimension is the same as that of the initial XML-INTO. In this case, XML-INTO populates the array with the PCDATA only of the element.
Such an extra XML-INTO would be required for each missing PCDATA element.
Peter
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Peter Connell
Sent: Thursday, 16 July 2009 4:45 p.m.
To: RPG programming on the IBM i / System i
Subject: RE: XML-INTO element has data plus attribute
Birgitta,
Thanks, maybe I should start visiting the café.
It's a bummer that there was no PTF for V5R4, which is where I'm at.
Peter
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Birgitta Hauser
Sent: Thursday, 16 July 2009 4:30 p.m.
To: 'RPG programming on the IBM i / System i'
Subject: AW: XML-INTO element has data plus attribute
Hi Peter,
in march or april a new PTF was shipped with several enhancements for the
XML-INTO.
Please check the following link:
http://www-949.ibm.com/software/rational/cafe/thread/1996?tstart=15
with this enhancements you need to define a datastructure with the subfields
status and the subfield Employment.
The attribute value EMP01 will be returned into the subfield status and
fulltime will be returned into the subfield employment.
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 Connell
Gesendet: Thursday, 16. July 2009 02:52
An: RPG400-L@xxxxxxxxxxxx
Betreff: XML-INTO element has data plus attribute
XML-INTO - how to extract both the data and the attribute from an
element?
<Report>
<Employment status="EMP01">Fulltime</Employment>
</Report>
I can get the status attribute by defining Employment as a nested data
structure
D Employment LikeDS(EmplDS)
D InsEmplDS DS Qualified
D Status 5
But how can I get the data value "Fulltime"?
Peter
Visit our website www.vedaadvantage.com. It has a new design with improved
navigation and search capabilities; and customer friendly interface with
more relevant insights and solutions to help you make informed decisions.
############################################################################
#########
This correspondence is for the named person's use only. It may contain
confidential
or legally privileged information, or both. No confidentiality or privilege
is waived
or lost by any mistransmission. If you receive this correspondence in error,
please
immediately delete it from your system and notify the sender. You must not
disclose,
copy or rely on any part of this correspondence if you are not the intended
recipient.
Any views expressed in this message are those of the individual sender,
except where
the sender expressly, and with authority, states them to be the views of
Veda Advantage.
If you need assistance, please contact Veda Advantage on either :-
Australia 1300-921-621 or New Zealand +64 9 367 6200
As an Amazon Associate we earn from qualifying purchases.