Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Parse multiple models of 1 metamodel
[Acceleo] Parse multiple models of 1 metamodel [message #1753787] Fri, 10 February 2017 08:56 Go to next message
Julien Pourille is currently offline Julien PourilleFriend
Messages: 8
Registered: February 2017
Junior Member
Hye everybody,

I have something to do on a project but I don't know how to do this.

I have an ecore metamodel (Metamodel_A) which has been generated from XML schema (XSD) => OK
I have multiple XML files which corespond to the XML schema and so to the ecore metamodel (Metamodel_A)
I have an other ecore metamodel (Metamodel_B)
I have a XMI file which correspond to the ecore metamodel (Metamodel_B)

Currently, I parse XMI file whith acceleo to create some HTML files whith data contained in XMI file => OK

But what I want to do is to parse XMI file AND all XML files of metamodel_A and fill some part of my HTML output files with data contained in XML files....

So when I parse XMI file, and i find an object Function whith an id = "toto", i have to find in XML files the function with the same ID and get some data to fill HTML files..

I don't know if i'm clear but in my head it's very confused!!

thanks for help
Re: [Acceleo] Parse multiple models of 1 metamodel [message #1753791 is a reply to message #1753787] Fri, 10 February 2017 09:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5969
Registered: July 2009
Senior Member
Hi

In a pure modeling implementation B would refer to A so that the XML for B would have direct references to the XML for A. No problem.

If you have to keep them separate, then you have to have your own form of referencing, perhaps just a simple string such as "toto", perhaps a hierarchical string such as "rock.toto", so you have to provide your own lookup mechanism, probably using an Acceleo helper/query that accepts a String and returns a corresponding object.

Regards

Ed Willink
Re: [Acceleo] Parse multiple models of 1 metamodel [message #1753796 is a reply to message #1753791] Fri, 10 February 2017 09:50 Go to previous message
Julien Pourille is currently offline Julien PourilleFriend
Messages: 8
Registered: February 2017
Junior Member
Hi,

Thanks for your response,

In fact metamodel_A and metamodel_B have no relation.

But in XML file which corresponds to metamodel_B there are objects with an attribute Id
In the other XML files which correspond to metamodel_A, there are objects with attribute Id too


Concretely,

Curently, acceleo parse XMI file (from metamodel_B) which a for example a list of object "Function". In my template I have the sequence of Function, i have a for loop on this sequence.

For the first Function, i get his Id (for example : "toto"). What I have to do is to search in all others XML file (from metamodel_A) which one has the Id = "toto" and get this object in acceleo to complete my template.

Is it more clear?
Previous Topic:[Acceleo] Duplicate query/operation detection, bug?
Next Topic:[Acceleo] Generation in one thread
Goto Forum:
  


Current Time: Mon Jul 16 19:55:08 GMT 2018

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

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

Back to the top