MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Exporting graph to XML
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Exporting graph to XML

 Post Reply Post Reply
Author
Message
mafkees01 View Drop Down
Member
Member


Joined: 20.Jan.2012
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mafkees01 Quote  Post ReplyReply Direct Link To This Post Topic: Exporting graph to XML
    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!
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 20.Jan.2012 at 17:39
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.
 
Back to Top
mafkees01 View Drop Down
Member
Member


Joined: 20.Jan.2012
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mafkees01 Quote  Post ReplyReply Direct Link To This Post Posted: 20.Jan.2012 at 23:35
Originally posted by stevek stevek wrote:

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.
 


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
Back to Top
mafkees01 View Drop Down
Member
Member


Joined: 20.Jan.2012
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mafkees01 Quote  Post ReplyReply Direct Link To This Post Posted: 23.Jan.2012 at 16:19
It works Big%20smile. Thank you very much!
Back to Top
mafkees01 View Drop Down
Member
Member


Joined: 20.Jan.2012
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mafkees01 Quote  Post ReplyReply Direct Link To This Post Posted: 25.Jan.2012 at 13:37
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.
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 25.Jan.2012 at 13:42
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
Back to Top
mafkees01 View Drop Down
Member
Member


Joined: 20.Jan.2012
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mafkees01 Quote  Post ReplyReply Direct Link To This Post Posted: 25.Jan.2012 at 18:39
I noticed thank you!
I am probably thinking too difficult in certain situations whereas the solution is rather simple. Thank you!
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 25.Jan.2012 at 18:42
Thanks, we like to make things as simple as possible!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.047 seconds.