Generating ATL and XSLT from the same weaving model

This example generates XSLT and ATL transformations from the same weaving model. It contains two ATL HOTs (higher-order transformations). The first HOT transforms a weaving model into an ATL model. The second HOT transforms a weaving model into an XSLT model.


Loading the weaving model into AMW:
The weaving model (models/FK2Nested_AMW.ecore) must be loaded using the wizard to be able to create the metadata file in the workspace.
This step does not need to be executed to produce the HOTs.
Left metamodel: metamodels/FKMetaSchema.ecore.
Right metamodel: metamodels/NestedMetaSchema.ecore.


Executing the HOT:
The file hot/AMWtoATL.atl is a higher-order transformation. There is a launch configuration file with the input and output models.
The transformation produces a transformation model output_atl/ATL-model.ecore. The output model must be extracted into the ATL technical space (i.e., produce an ATL file). The model may be extracted by right-clicking in the ecore model in the "AM3 Resource Navigator" view and by clicking in "Extract ATL-0.2 model into ATL-0.2 file". This action produces the ATL-model.atl file.
When using ATL versions before "January 13, 2006", use AMWtoATL_old.atl to be compatible with previous versions of the ATL metamodel.

Executing the transformation:
The ATL-model.atl transformation transforms the models/libraryFK.ecore model (conforms to metamodels/FKMetaSchema.ecore) into models/libraryNested.ecore (conforms to metamodels/NestedMetaSchema.ecore). Use the launch configuration that is provided in the .zip file.


Executing the HOT:
There is an Ant Script (/generateXSLT.xml) that automatically produces the XSLT file. It executes the following actions:

Executing the transformation:
The XSLT transformation takes as input a XML file (xslt/libraryFK.ecore) and produces the xslt/output.xml file.
Remark: We used XMLSpy as XSLT engine.

These transformations can be executed separatedly as well. Each transformartion has a predefined "launch configuration" file.