Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Change output format to XML instead XMI
Change output format to XML instead XMI [message #508930] Wed, 20 January 2010 18:18 Go to next message
Aubrey Mising name is currently offline Aubrey Mising nameFriend
Messages: 6
Registered: January 2010
Junior Member
Hi,
I made a transformation between ecore models using ATL, the target ecore metamodel was extracted from a XML-Schema means of EMF.

So, my output format is XMI and I want to know how to change this format to XML.

Thanks, Aubry.
Re: Change output format to XML instead XMI [message #509046 is a reply to message #508930] Thu, 21 January 2010 09:37 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
If you use an ATL launch configuration, you can use the file extension defined in your EMF genmodel. If your file extension is library, then you should name your out model xxxx.library, the corresponding serializer will then be used instead of the XMI one.

If you launch your transformation programatically, you can chose your file extension but you have to associate this file extension to your serializer before executing the transformation.

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(your file extension here, your factory here);

The first solution is also possible if you don't care about the file extension.
Re: Change output format to XML instead XMI [message #509084 is a reply to message #509046] Thu, 21 January 2010 11:16 Go to previous messageGo to next message
Aubrey Mising name is currently offline Aubrey Mising nameFriend
Messages: 6
Registered: January 2010
Junior Member
Thank you for your answer Sylvain but I'm a beginner and I can't understand something.

I'm using ATL launch configuration but how can I use my EMF genmodel file extension in my configuration? Have I to use the genmodel instead of the ecore generated by EMF?

I change the extension of the output model (not metamodel) to xml, but this isn't works.

Thank you!!
Re: Change output format to XML instead XMI [message #509127 is a reply to message #508930] Thu, 21 January 2010 13:15 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You have to use the extension defined in the genmodel.

Open your genmodel and there is a file extensions attribute on your EPackage. The default value is the name of your EPackage in lower case.
Re: Change output format to XML instead XMI [message #509175 is a reply to message #509127] Thu, 21 January 2010 15:19 Go to previous message
Aubrey Mising name is currently offline Aubrey Mising nameFriend
Messages: 6
Registered: January 2010
Junior Member
Thanks Sylvain but I'm very ignorant (I think so) and I can't understand you.

When we make a transformation from a XML-Schema to ecore using EMF, some files are generated: xxx.genmodel, xxx.xsd2ecore and some ecores depends on our schema. I suppose that you refer to .genmodel but when I open (EMF generator and Text editor) this file I don't see any file extension and I can't find any extension when I open the xsd2ecore.

When I configure the launch what metamodel I have to use? Is ecore or anyone else?

It's probably that I'm telling you something very stupid but I'm a beginner.
Previous Topic:XMI ID Extraction by ATL Transformation
Next Topic:[ATL] tarnsform a GMF based diagram
Goto Forum:
  


Current Time: Thu Mar 28 21:09:30 GMT 2024

Powered by FUDForum. Page generated in 0.07128 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top