Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » XML conversion issue(Feather in my cap or a black eye?)
XML conversion issue [message #766949] Fri, 16 December 2011 18:05 Go to next message
Dan Darnell is currently offline Dan DarnellFriend
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member
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 Go to previous messageGo to next message
Joseph Vincens is currently offline Joseph VincensFriend
Messages: 31
Registered: December 2011
Location: Prospect CT
Member
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 Go to previous messageGo to next message
Dan Darnell is currently offline Dan DarnellFriend
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member

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 #767042 is a reply to message #767034] Fri, 16 December 2011 23:01 Go to previous messageGo to next message
Dan Darnell is currently offline Dan DarnellFriend
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member

Bug report submitted:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=366994
Re: XML conversion issue [message #768049 is a reply to message #766949] Mon, 19 December 2011 13:41 Go to previous messageGo to next message
Will Smythe is currently offline Will SmytheFriend
Messages: 41
Registered: July 2009
Member
Dan - can you explain what a 'tiny amount of tweaking' involved? Is the New Record wizard not producing accurate EGL code?
Re: XML conversion issue [message #768167 is a reply to message #768049] Mon, 19 December 2011 17:27 Go to previous messageGo to next message
Dan Darnell is currently offline Dan DarnellFriend
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member
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]

Report message to a moderator

Re: XML conversion issue [message #768278 is a reply to message #767034] Mon, 19 December 2011 20:47 Go to previous message
Dan Darnell is currently offline Dan DarnellFriend
Messages: 145
Registered: November 2011
Location: Arkansas
Senior Member


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
Previous Topic:Lesson 4 - bug in design view of TitlePane
Next Topic:Editor(Dojo) problem
Goto Forum:
  


Current Time: Fri Nov 28 00:49:55 GMT 2014

Powered by FUDForum. Page generated in 0.02016 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software