Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [ACCELEO]last version(what is the difference between the last version and others version)
[ACCELEO]last version [message #669325] Mon, 09 May 2011 22:26 Go to next message
radwane  is currently offline radwane Friend
Messages: 27
Registered: April 2011
Junior Member
can i add new metamodel and run generate.mtl with file.xmi in the last version because i cant do it with others version just it posiible with file.uml and files.ecore .
my metamodel is not existe in platform so i try to add it but i cant also run generate file with file.xmi so what i can do ????
Re: [ACCELEO]last version [message #669380 is a reply to message #669325] Tue, 10 May 2011 06:44 Go to previous message
Eclipse UserFriend
Originally posted by:


You must make it a bit easier for us to help you. First tell us what you
want to achieve and then what you actually have tried. And provide a
little more detail, often you just have to fix small things to make it work.

Acceleo lets you transform a file with _model instances_ (i.e. a data
file) into text, by means of a template. In the template you refer to
_classes in the _model_, and these classes reside in a _package_. At the
top of the template you must indicate the _package_'s URI (identifier),
otherwise Acceleo cannot validate that the template's use of the model
is syntactically correct.

From your example in a previous post, is looks like you have tried
using UML as the model. This means that the _model instance_ contains
instances of classes such as Class, Attribute, Association and so forth.
If you transform Ecore instances instead, your template similarly
operates on instances of classes such as EClass, EAttribute, EReference.
Similar concepts as in UML, but with different names, so you'll need to
rename the class names throughout the template. Also, the package URI is
different, so it must be changed.

Often you can guess the package URI from the file's extension, e.g.
Ecore models usually use the ecore extension, but in the general case
xmi is used. So if you say a file has the xmi extension, it doesn't help
us understand what model it is, you must look inside the file to
identify the package and classes of the model.

E.g. I'm preparing an example model for a library and the top of the
library instance file (.xmi) looks like the following:

<library:LibraryModel xmi:version="2.0"
xmlns:library=" platform:/plugin/org.eclipse.emf/js4emf/examples/library/lib rary.ecore "
xsi:schemaLocation=" platform:/plugin/org.eclipse.emf/js4emf/examples/library/lib rary.ecore
<allLibraries name="General library">

The "library" prefix of the <library:LibraryModel ...> tag refers to the
library package, and you can find its URI as the value of the
xmlxn:library attribute, in this case it's
platform:/plugin/org.eclipse.emf/js4emf/examples/library/lib rary.ecore.
This value should be used in the template to refer to the package.

Hope this helps.

Previous Topic:[Acceleo3] How to process XML models?
Next Topic:an executable file
Goto Forum:

Current Time: Fri Dec 01 13:19:10 GMT 2023

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

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

Back to the top