|[ATL] Getting ATL output file to correspond to correct Meta-Model [message #715073]
||Fri, 12 August 2011 09:53
| Anders Olsson
Registered: July 2009
I'm running an ATL transformation programmatically using the CoreService/Injector method (just like this guy: http://www.eclipse.org/forums/index.php/mv/tree/207021/662785/).
Things are working fine, for most parts. I have one problem I can't iron out: I can't get proper serialization when I specify an output file with the wrong file extension. That is, in the end step
, I get different output depending on if the extension is e.g. "xml" or if it's "mixed" (the default for my meta-model).
I know file extensions are holy to EMF, and that this behavior is quite expected. When the file extension is "xml" it will choose the default Factory for that type, which is XMI. What I'm interested in is how I register my Meta-model's Factory as the one to use for this file extension during this operation.
I've previously been guided on how this is done on a global or ResourceSet level (http://www.eclipse.org/forums/index.php/t/207614/), but fail to see how they would be used here. I have no control over which ResourceSet is used during the extraction, and setting this globally didn't do what I'd hoped. I used:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("XML", new MixedResourceFactoryImpl());
but that caused problem when doing other operations, and made no difference for the output.
Is there a proper way to achieve this in ATL?
Thanks & Best Regards,
[Updated on: Fri, 12 August 2011 09:54]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.13956 seconds