|Re: [ACCELEO]last version [message #669380 is a reply to message #669325]
||Tue, 10 May 2011 06:44
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:
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
This value should be used in the template to refer to the package.
Hope this helps.
Powered by FUDForum
. Page generated in 0.01776 seconds