I'm trying to programmatically extract information from an Enterprise Architect model (saved in an XMI file) - I need it to generate some reports, but I don't want to go so far as to create an EA add-in. Is there a C# XMI parser library anywhere?
I could of course generate XMI parsing code from its XML schema, but that would be my second option.
Capture a diagram as an image fileIn the 'Save as type' field, click on the drop-down arrow and select the appropriate graphic format. Click on the Save button.
Open the project to copy from. In the Browser window, click on the Package to copy and use your preferred Export access method to open the 'Export Package to XML' dialog. Select the appropriate options and filename. Click on the Export button to begin the export process.
Do you really need an XML? EA saves its information in a database (Standard Jet DB alias MS Access format as of EA 7.5 despite its eap file extension), it should be easy to query. Another way is to use Automation interface (in C# you will need to import Interop.EA) to gain access to everything EA stores and also to diagrams that are generated.
Ok, what I've discovered so far is that there are different versions of XMI. To quote Wikipedia:
Several versions of XMI have been created: 1.0, 1.1, 1.2, 2.0 and 2.1. The 2.x versions are radically different from the 1.x series.
I exported EA model both to 1.1 and 2.1 and the exports really do look different, starting from top XML elements. So I guess when talking about a MI parser, you first have to specify which XMI version you are interested in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With