Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Integrate xml into my dsl ('hidden' transformation)
Integrate xml into my dsl ('hidden' transformation) [message #1301755] Fri, 18 April 2014 09:30 Go to next message
Kevin Wiedener is currently offline Kevin WiedenerFriend
Messages: 9
Registered: May 2012
Junior Member
Hi Xtext experts,

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?

Many thanks for your help and happy Easter Wink
Kevin
Re: Integrate xml into my dsl ('hidden' transformation) [message #1312376 is a reply to message #1301755] Thu, 24 April 2014 08:51 Go to previous messageGo to next message
Kevin Wiedener is currently offline Kevin WiedenerFriend
Messages: 9
Registered: May 2012
Junior Member
As no one answers it, I assume there is no way to do that at all?
Re: Integrate xml into my dsl ('hidden' transformation) [message #1312411 is a reply to message #1312376] Thu, 24 April 2014 09:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
It is such pita that nobody wants To help

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Integrate xml into my dsl ('hidden' transformation) [message #1313027 is a reply to message #1312376] Thu, 24 April 2014 16:59 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi Kevin,

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
format.

HTH,
Axel


Kevin Wiedener wrote:

> As no one answers it, I assume there is no way to do that at all?
Re: Integrate xml into my dsl ('hidden' transformation) [message #1313128 is a reply to message #1313027] Thu, 24 April 2014 18:18 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
And depending on "the xml" and the semantics of usage/integration you want to have http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/ might work as well


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Resolve Proxies during linking phase
Next Topic:scoping, auto complete and validation
Goto Forum:
  


Current Time: Sat Apr 20 03:51:56 GMT 2024

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

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

Back to the top