XML conversion issue [message #766949] |
Fri, 16 December 2011 13: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 #768278 is a reply to message #767034] |
Mon, 19 December 2011 15: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.03210 seconds