Version 0.3
Copyright © 2010 - 2011 Lars Vogel
24.02.2011
| Revision History | ||
|---|---|---|
| Revision 0.1 | 07.07.2010 | Lars Vogel |
| Created | ||
| Revision 0.2 - 0.3 | 24.10.2010 - 24.02.2011 | Lars Vogel |
| bugfixes and enhancements | ||
Table of Contents
Xpand is a template engine which allows to create text output from EMF models . The text output can be a programming language or something else. Xpand requires that you define your EMF metamodel and one or more templates which will translate the model into text. Once this definition is done you can run the code generator by defining a EMF model and by running the generator.
This article will show how to translate the website model from EMF Tutorial into an HTML representation.
Install the "Xpand SDK" via the Eclipse update manager .
Create a new Xpand Project "de.vogella.xpand.htmlconvert".

Create or copy the EMF website model from the EMF tutorial into your project under the "src" folder in a new folder "metamodel". Create also the folders "model", "templates" and "workflow" in "src".
Create an instance of your model by selecting in "webpage.ecore" the "Web" model element, right-clicking on it and selecting "Create dynamic instance".

Create the file "Web.xmi" in the folder "model".

In the folder "template" create a new Xpand template "htmlTemplate.xpt".
Before posting questions, please see the vogella FAQ. If you have questions or find an error in this article please use the www.vogella.com Google Group. I have created a short list how to create good questions which might also help you.