Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Higher order transformation
Higher order transformation [message #1062391] Fri, 07 June 2013 14:00 Go to next message
Michal Kleczek is currently offline Michal Kleczek
Messages: 23
Registered: May 2013
Junior Member
Hi,
I have several metamodels imported from XML schemas. I would like to use XML extractor to save models conforming to those metamodels to XML files.
But I do not want to define a transformation for each of the metamodels. The rules to transform to XML metamodel are actually all the same and are based on information in the metamodels.
Is it possible to create a single transformation that would do that. Something like:

create OUT : XML from METAIN : ECORE, IN : METAIN;
...


Thanks,
Michal
Re: Higher order transformation [message #1062428 is a reply to message #1062391] Fri, 07 June 2013 16:08 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 604
Registered: July 2009
Senior Member
Hello,

If your metamodel (in Ecore) has been directly created from an XML schema, then EMF itself is already able to import corresponding XML documents as models and to export back such models as XML documents.
You should take a look to the EMF documentation to get more info about this.


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Higher order transformation [message #1062547 is a reply to message #1062428] Sat, 08 June 2013 16:48 Go to previous messageGo to next message
Michal Kleczek is currently offline Michal Kleczek
Messages: 23
Registered: May 2013
Junior Member
Hugo Bruneliere wrote on Fri, 07 June 2013 12:08
Hello,

If your metamodel (in Ecore) has been directly created from an XML schema, then EMF itself is already able to import corresponding XML documents as models and to export back such models as XML documents.
You should take a look to the EMF documentation to get more info about this.


The problem really is I could not find any way to automate loading/saving instance documents (eg. an ant task).
Re: Higher order transformation [message #1062676 is a reply to message #1062547] Mon, 10 June 2013 10:51 Go to previous message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 604
Registered: July 2009
Senior Member
Hello,

You could do this via Java code to automate the full process/chain.


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Previous Topic:Change Source Element
Next Topic:ArrayIndexOutOfBoundsException with ->at(1) although size is 2
Goto Forum:
  


Current Time: Sat Sep 20 12:14:33 GMT 2014

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

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