XML conversion issue [message #766949] |
Fri, 16 December 2011 18:05  |
Eclipse User |
|
|
|
First of all, who can tell me where my topic description came from ("feather in my cap or a black eye?") No fair Googling it. I am offering one Pluta Point for it. (I won two PP's from Joe the other day. I am selling the other one on E-Bay.). I use this tag line because I am working on writing something for publication and it could be a feather in our collective caps (as fervent EDT'ers) or, if it doesn't work, a black eye (for me anyway). What I am doing works great in RBD but EDT is where I need this to happen or else I am sunk.
Okay, the issue is this....
Here are some records definitions in their EDT form (created using the Record wizard from XML data with just a tiny amount of tweaking):
record XMLServiceParms {@XMLRootElement{name = "pgm"}}
lib string {@XMLAttribute{}};
name string {@XMLAttribute{}};
parms Parm[] {@XMLElement{name = "parm"}};
end
Record Parm
data Data;
end
record Data {@XMLValue {kind = XMLStructureKind.simpleContent}}
type1 string {@XMLAttribute{name = "type"}};
value string?;
end
When I do this:
myPGMParms XMLServiceParms {lib = "MYLIB", name = "MYPGM"};
myPGMParms.parms = new Parm[0];
myPGMParms.parms.appendElement(new Parm { data = new Data { type1 = "40a", value = "Dan" } } );
xmlin string = XMLlib.convertToXML(myPGMParms, true);
(Note: I tried "xmlin string = XMLlib.convertToXML(myPGMParms, false)" with the same results.)
The results (not correct) look like:
<pgm lib="MYLIB" name="MYPGM"><parm><data type="40a"><value>Dan</value></data></parm></pgm>
When I run the equivalent in RBD the (correct) results are:
<pgm lib="MYLIB" name="MYPGM"><parm><data type="40a">Dan</data></parm></pgm>
What can I do to make the "value" tag not appear in the XML? (Side note: the EDT help on this topic is all over the place ... showing some examples using obsolete RBD syntax and some examples using inaccurate EDT syntax. Therefore, it is exceptionally difficult to know if I am overlooking something or if this is a bug.)
Any help would be incredibly appreciated! Remember...possibility here for a feather in our caps!
--Dan
|
|
|
Re: XML conversion issue [message #767031 is a reply to message #766949] |
Fri, 16 December 2011 22:25   |
Eclipse User |
|
|
|
Hi Dan,
This is a defect in the XMLLib.ToXML function. It's ignoring the @XMLValue.
Please open a defect on this so we get it taken care of for the next release.
regards,
Joe
|
|
|
Re: XML conversion issue [message #767034 is a reply to message #767031] |
Fri, 16 December 2011 22:34   |
Eclipse User |
|
|
|
Hi Joe. Thanks for the feedback.
Wondering...is this the sort of thing that might be fixed in a nightly build in the near term? Or will it truly be April 2012 or beyond before it will be fixed?
It truly sucks that there isn't some workaround that could get the job done so that I can toot the horn of EDT again in a big way to the IBM i crowd.
--Dan
|
|
|
|
|
Re: XML conversion issue [message #768167 is a reply to message #768049] |
Mon, 19 December 2011 17:27   |
Eclipse User |
|
|
|
Hi Will.
The wizard did fine. Total tweaking on my part involved adding the @XMLElement annotation to the following:
parms Parm[] {@XMLElement{name = "parm"}};
...and renaming "egl_value" to "value" in the following:
value string?;
...and renaming the root level record from "Pgm" to "XMLServiceParms".
The wizard (correctly) brought over the tag/variable under the name "parm" but I wanted it to be "parms" from a coding perspective while retaining the correct tag name.
This didn't have any influence on the bug being reported but I didn't want anyone to look at the records, see my small tweaks, and say, "hey, the wizard didn't do that!"
Good question on your part though and I appreciate it. I wasn't clear in my original post that the tweaking involved was elective and cosmetic.
--Dan
[Updated on: Mon, 19 December 2011 17:32] by Moderator Report message to a moderator
|
|
|
Re: XML conversion issue [message #768278 is a reply to message #767034] |
Mon, 19 December 2011 20:47  |
Eclipse User |
|
|
|
Ah, fast work on the developer's part and there is already a patch for this (available as attachment to the bug report). I also understand that this should be in the first milestone release for 0.8.
I applied the patch and it worked great!
Thanks!
--Dan
|
|
|
Powered by
FUDForum. Page generated in 0.03737 seconds