Generating models from XML files

I would like to import XML data files into MPS environment and turn them into arbitrary models.
How should I go about this?
If you want just importing, the simplest way is to write your custom "action" in plugin aspect of some language, which will parse your XML and turn them into models. To access model structure, use the jetbrains.mps.smodel language. Add this action to any of the existing "groups" and you'll see it in the corresponding context/main menu.

More info on plugin aspect, actions and action groups:
More info on smodel language:
If you experience any problems, please feel free to ask.

You can also import your models in read-only mode on-demand. See how the "stubs" models can be provided here:
and search this forum also. In the next versions of MPS we plan to introduce a fully-custom persistence with read/write operations. For now, only the read-only models can be provided.

May be I should be implemented as custom persistence for XML models in nearly future? ;)
I've heard about your project from Ilya Lintsbah, and we've decided to discuss it with the team. Maybe we could try implementing this functionality in 2.1
How does one go about creating new actions?

The page and tutorial referenced therein do not help.

The tutorial is recent, but already seems outdated:
I am unable to complete the step "Now we have to create a Group." because the menu that appears when right clicking on plugins does not provide the choices listed in the snapshot associated with the step. I only see New "Facet" under the plugin menu in version 2.5 of MPS (build 117-9351), where I am supposed to be able to select a New "Group".
You can find the Group in the language jetbrains.mps.lang.plugin. In the Model Properties of the plugin aspect add it to the Used Languages and you will be able to create a Group.

Thanks, that worked. To continue the tutorial, I also had to include the swing stubs in the plugin imported models (i.e., under module properties of the Language plugin aspect, added JDK/javax.swing@java_stub). It then became possible to use JOptionPane (adding to Accessory Models of the Language as per the tutorial was not sufficient).
Thanks for your help. I was able to complete the tutorial, unfortunately,
no new menu is displayed under Tools nor is there any error report. Not
sure where to go from there.

On Wed, Dec 12, 2012 at 1:31 PM, Sascha Lißon - Meta Programming System <> wrote:

* Meta Programming System<>
* > * Generating models from XML files<>
* [ * xml <> *] 1:31
* updated 1:31 pm * Sascha Lißon <>

You can find the Group in the language *jetbrains.mps.lang.plugin*. In
the Model Properties of the plugin aspect add it to the *Used
Languages* and you will be able to create as *Group*.

[image: image1]</_persistent/image1?file=29-2333&v=0&c=true>

   Fabien Campagne<>@ 12:57

How does one go about creating new actions?

The page tutorial referenced therein do not help.

Fabien Campagne, PhD –

Assistant Professor,    Dept. of Physiology and Biophysics
          Institute for Computational Biomedicine
Associate Director,      Biomedical Informatics Core,
       Clinical Translational Science Center

Weill Medical College of Cornell University
phone:  (646)-962-5613  1305 York Avenue
fax:    (646)-962-0383  Box 140
New York, NY 10021

Do you speak next-gen?

See how GobyWeb can help simplify your NGS projects at
  1. Add the language jetbrains.mps.lang.plugin.standalone to the Used Languages of the plugin aspect.
  2. Add a StandalonePluginDescriptor to your plugin aspect.
On Fri, Dec 14, 2012 at 10:51 AM, Sascha Lißon - Meta Programming System <

Please sign in to leave a comment.