I'm not sure if my idea is the appropriate way how to solve such stuff, so any ideas or better solutions are welcome.
I have XML files from a third party tool and would like to use/integrate them into my DSL. Maybe its important to say, that the XML file describes content that is very similar to the content of my DSL. So you can consider it as another file format for similar content (therefore a XML -> my DSL conversion should be theoretically possible IMHO).
I assume one solution might be to use an XSD to Ecore converter and do some magic when importing the XML files through importURI. My DSL needs to be adjusted and has to use the converted Ecore model as reference. If this is the appropriate way, are there any blogs, links or references on how to implement this (I know how to use another ecore model within my grammar, but how to do the on-the-fly conversion when using importURI)?
Or is it a better solution to use the XML file, do some magic on importURI again and convert the XML on the fly into a model that fits my existing DSL? The difference is that I need to define some converter that transforms the XML stuff into my existing DSL/ecore model and that I do not need to adjust the grammar.
What is your opinion? What is the better way to do that (I mean from the perspective of performance, not from the perspective of complexity)? And do you know some reference implementations?
you can cope with such a requirement if you see it as an import process. You
can create an xml importer action/command. The user chooses a xml file using
a file selection dialog, then you read in the xml data, create and configure
new instances of corresponding meta classes and persist this in your dsl
Kevin Wiedener wrote:
> As no one answers it, I assume there is no way to do that at all?