Hi Emre,
Actually you do not need to do anything special in order to achieve that. Just create objects from desired metamodels. For example:
modeltype UML uses "http://www.eclipse.org/uml2/4.0.0/UML";
modeltype Ecore uses "http://www.eclipse.org/emf/2002/Ecore";
transformation NewTransformation(in src : UML, out dst : UML);
main() {
object EClass {
name := "ECore class"
};
object Class {
name := "UML class"
}
}
Type of transformation parameters' 'dst' (which is 'UML') is used as a hint on file extension to be used for output file. For the transformation above output file 'NewTransformation.uml' has the following content:
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML">
<ecore:EClass xmi:id="_5XiVUMbtEeKBSPmarAtVhQ" name="ECore class"/>
<uml:Class xmi:id="_5XiVUcbtEeKBSPmarAtVhQ" name="UML class"/>
</xmi:XMI>
Regards,
Sergey