|Re: How to transform xText to XMI [message #666121 is a reply to message #666101]
||Tue, 19 April 2011 08:13
| Jan Koehnlein
Registered: July 2009
this seems to be a bug in the sample Ecore editor, which renames the
resource's URI rather than creating a new one with the extension from
the new URI, if it's not a conversion between "ecore" and "emof":
if (currentExtension.equals(ECORE_FILE_EXTENSION) &&
Resource newResource = resourceSet.createResource(newURI);
Am 19.04.11 09:07, schrieb Ed Willink:
> Hi Christian
> This is an area where I feel that Xtext has been too clever.
> You can open an Xtext CS file in the Sample Ecore Editor and see the
> tree view, but if you then do SaveAs *.xmi, the result is saved as CS
> text rather than XMI text. Somehow Xtext has higher priority than XMI.
> It would be nice to have this interactive approach work fully.
> Ed Willink
> On 19/04/2011 06:44, Christian Dietrich wrote:
>> if you work e.g. with a programmatically read model it is actually an
>> model instance based on the generated ecore.
>> How you can read in the model files standalone you can find in the
>> docs section Processing Xtext Models.
>> If you still need an XMI Feel free to move the contents of the read
>> Xtext Resource to and XMI Resource.
>> ResourceSet rs = new ResourceSetImpl();
>> Resource resource = rs.getResource(URI.createURI("./mymodel.dmodel"),
>> EObject eobject = resource.getContents().get(0);
>> Resource xmiResource = ....
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Get professional support from the Xtext committers at www.typefox.io
|Re: How to transform xText to XMI [message #697619 is a reply to message #666310]
||Sun, 17 July 2011 13:08
| Marten Sijtema
Registered: November 2009
Currently I too use this approach, save it as .xmi, which is then read by eg. ATL (in an ant based transformation sequence). |
Christian, do you still think there is need for m2m transformations, that read the xtext-generated xmi model, and transform it, followed by an eventual XPand transformation to text?
Because this is my current approach (ie. I have an MDA that generates webapps). Allthough I don't use any expressions in my model, just declarative structural stuff, and generate 'defaults' in terms of behaviours, so for that purpose I'd say the XTend thing is very useful.
I wonder what your opinion is about this.
My company: Sytematic, building business software from models.
Powered by FUDForum
. Page generated in 0.02631 seconds