Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Inject XML file through AM3
Inject XML file through AM3 [message #668525] Fri, 06 May 2011 04:32 Go to next message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
I have a problem installing AM3 from SVN. I need to inject an XML file (a MS Excel file of type XML) to an XML model that conforms to an XML metamodel. Following this link http://wiki.eclipse.org/AM3/How_Install_AM3_From_SVN

I couldn't find SVN Repository. I have only CVS Repository Exploring. From where I can install SVN for Eclipse Helios or for Galilio 3.5.2.

I appreciate if anyone could help me and send me the website to install SVN. I'm also wondering if this old plugin AM3 works with Eclipse 3.6.2 and ATL 3.1.2.

Thanks in advance,

Sally
Re: Inject XML file through AM3 [message #668577 is a reply to message #668525] Fri, 06 May 2011 10:17 Go to previous messageGo to next message
Cesar Caves is currently offline Cesar CavesFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Sally.

I was struggling about installing AM3 from SVN.
At the end, I found a topic within the AM3 forum where it was reported that

"You can find from http://docatlanmod.emn.fr/Eclipse_Bundles/AMMA_Prototype/AMM APrototypeEclipse.zip a bundle including compatible versions of ATL2.x and AM3."

So I downloaded this Eclipse RCP and now I can use the XML injection and extraction facilities from the pop-up menu.

Good luck !

César

[Updated on: Fri, 06 May 2011 10:24]

Report message to a moderator

Re: Inject XML file through AM3 [message #668581 is a reply to message #668577] Fri, 06 May 2011 10:23 Go to previous messageGo to next message
Cesar Caves is currently offline Cesar CavesFriend
Messages: 29
Registered: July 2009
Junior Member
Inside this Eclipse RCP I can invoke "Inject XML file to XML model (Ecore based)" from the pop-up menu that appears when right click on an XML file

Notice that when a new ATL project is created, the Eclipse workbench changes to ATL perspective, where the options "injection" and "extraction" are not present in the right click pop-up menu. But if you change to AM3 perspective (be careful, "AM3" perspective, not the "AM3 Megamodeling" one) those options should appear.

Is true that this Eclipse bundle is a bit old (3.4.2, with ATL 2.0.0) so I only use it for injection and extraction tasks, dragging the resulting files to other workspaces running on Galileo or Helios Eclipse installations, where ATL 3.x is present.

Best regards.

César
Re: Inject XML file through AM3 [message #668592 is a reply to message #668581] Fri, 06 May 2011 11:21 Go to previous messageGo to next message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
Thanks Cesar so much. I downloaded this Eclipse RCP and switched to AM3 perspective and it works fine!

I still have another question. I want to use this generated XML model to pass parameters to the ATL transformation. The model has to be in this format:
<parameters>
<param name="hostDemand" value="11"/>
<param name="msgSize" value="3"/>
</parameters>

I have several Excel parameters file and it's a terrible to manually put them in the previous format. That is way I think to inject them to XML model, but the generated XML model doesn't distinguish between the values (e.g. 11) and the parameter's name (e.g. hostDemand) both of them are considered as values for the attribute "value".

I think I need another ATL transformation to transform the generated XML model to the required format in order to pass the parameters. Does anyone have any idea about this transformation or any ATL use case that can help me figure out it.

Thanks in advance,

Sally
Re: Inject XML file through AM3 [message #669238 is a reply to message #668592] Mon, 09 May 2011 15:05 Go to previous messageGo to next message
Cesar Caves is currently offline Cesar CavesFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Sally.

At first sight, having into account that you are talking about Excel, have you looked at the use cases named "Microsoft Office Excel injector / extractor" at the transformations zoo http://www.eclipse.org/m2m/atl/atlTransformations/ ????

Regards
Re: Inject XML file through AM3 [message #669450 is a reply to message #669238] Tue, 10 May 2011 11:35 Go to previous message
Sally  is currently offline Sally Friend
Messages: 16
Registered: March 2011
Junior Member
Hi Cesar,

That's exactly what I looked at. So far, I can transform the Excel file to this syntax of an XML model

<children xsi:type="Element" name="Row">
<children xsi:type="Element" name="Cell">
<children xsi:type="Element" name="Data"/>
<children xsi:type="Attribute" name="name" value="hostDemand"/>
</children>
<children xsi:type="Element" name="Cell">
<children xsi:type="Element" name="Data"/>
<children xsi:type="Attribute" name="name" value="11"/>
</children>
</children>

But, I need this syntax

<children xsi:type="Element" startLine="2" startColumn="3" endLine="2" endColumn="50" name="param">
<children xsi:type="Attribute" name="name "value="hostDemand"/>
<children xsi:type="Attribute" name="value" value="11"/>
</children>

I don't know how I can get an Element such as "Cell" or "Row" contains the two Attributes and at the same time be able to identify the second attribute in order to change its name to "value" instead of "name". These two attributes contained in two different Elements "Data" and each "Data" element contained in different "cell".

Any hint will be appreciated,

Sally
Previous Topic:[atl]executable file
Next Topic:[AM3] AM3 perspective in Eclipse Helios
Goto Forum:
  


Current Time: Tue Nov 25 22:32:10 GMT 2014

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

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