Transformation input files

You can create files to use as input to a Java Emitter Template (JET) transformation. XML files are often the easiest to use because they are plain text; however, because JET is extensible, you can also create files that are based on the Eclipse Modeling Framework (EMF).

The input files that you use to test the transformation can exist in any Eclipse project.

The following example describes a transformation input model that contains a root element that has a mailFolder attribute and a mailing element. The mailing element contains two attributes and a JET file action. The attributes are called e-mail and firstName, and the JET action creates a file by evaluating a template called letter.html.jet:

This image illustrates the example described above.

The following XML code shows the contents of a sample input XML file that you can use as input to test the transformation:
<root mailFolder="output.data/letters">
	<mailing email="jsmith@email.com" firstName="Jane"/>
	<mailing email="sjones@letters.org" firstName="Sam"/>
</root>

When you run the JET transformation, the transformation generates two letters in the letters folder of the output.data project.


Feedback