Exporting graph to XML |
Post Reply |
Author | |
mafkees01
Member Joined: 20.Jan.2012 Points: 5 |
Post Options
Thanks(0)
Posted: 20.Jan.2012 at 17:19 |
Hello,
I have a question. I'm new to MetaEdit+ and I'm looking for a solution for my problem. I already e-mailed but still need some more help due to difficulties. I have a custom graph type which I use for developing models. After the creation, I want to export the model to XML. Rather than exporting each graph to XML via the menu, I prefer a button in the graph toolbar that allows me to export the model to XML directly. When the model is exported, I want to execute a program (that is installed on my pc) that reads the just generated XML file. Through mail I got the solution to use MERL for this and create custom constructs, however I still do not really know where to start. Hence is my question if can someone help me a little bit more. Is this possible and if so, how? Thank you in advance! |
|
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Post Options
Thanks(0)
|
Create a new generator called '!XML' - the ! means it will be shown as a button in the diagram editor toolbar.
The start of the generator will export the model to a .mxm file - MetaEdit+'s XML model format: filename id '.mxm' print Next you want to execute a program, let's say processXML.exe, with the new file as a parameter enclosed in double quotes: external 'processXML.exe "' id '.mxm"' execute Both these commands start and end with a keyword, and between the keywords we build up the filename or command. When you open one of your graphs, you'll see a new XML button at the end of the toolbar. Pressing it will export that graph and process it. If the graph has subgraphs, they'll be included. |
|
mafkees01
Member Joined: 20.Jan.2012 Points: 5 |
Post Options
Thanks(0)
|
Very much thanks for your help! Unfortunately I haven't MetaEdit+ available at the moment (only at office) so on monday I will test it directly and let you know whether i succeed. Your help is much appreciated. All the best, girov! Edited by mafkees01 - 20.Jan.2012 at 23:35 |
|
mafkees01
Member Joined: 20.Jan.2012 Points: 5 |
Post Options
Thanks(0)
|
It works . Thank you very much!
|
|
mafkees01
Member Joined: 20.Jan.2012 Points: 5 |
Post Options
Thanks(0)
|
Another question from my side. I want to change the default export location. The documentation states:
"You may override the default _imagemap_href generator in your own Graph types by making generators there with the same name. For instance, Project Model defines its own such generator. Add the USEMAP="#filename.gif" parameter to the IMG tag: the filename.gif should be exactly the same as the SRC parameter, preceded by #." However, where do I need to add the USEMAP parameter? I cannot find a clear example in the documentation. |
|
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Post Options
Thanks(0)
|
By 'export location' I guess you mean the filename? Just add the appropriate strings to your filename...print command, e.g.
filename 'C:\MyDirectory\' id '.mxm' print external 'processXML.exe "C:\MyDirectory\' id '.mxm"' execute _imagemap_href is for when you're printing an image as part of an HTML page, and is used to make the image on the page work as a clickable map. You don't need it now.
Edited by stevek - 25.Jan.2012 at 13:44 |
|
mafkees01
Member Joined: 20.Jan.2012 Points: 5 |
Post Options
Thanks(0)
|
I noticed thank you!
I am probably thinking too difficult in certain situations whereas the solution is rather simple. Thank you! |
|
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Post Options
Thanks(0)
|
Thanks, we like to make things as simple as possible!
|
|
Post Reply | |
Tweet |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |