Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read XMI?

I need to read UML diagrams that are serialized into XMI. Is there any library that would allow me to conveniently read UML XMI - by conveniently I mean having some methods to iterate over classes/packages/methods/attributest etc. in model.

I tried EMF, but I am unable to find any tutorial that would show how to import XMI containing UML. I have also found NSUML/NSMDF but the link to documentation is broken.

like image 455
kane77 Avatar asked Feb 20 '10 22:02

kane77


People also ask

How do I open an XMI file?

Right-click on the XMI file, and select "Open With" from the pop-up menu.

What is the difference between XML and XMI?

XMI is a specific application of XML. XMI can only be used for XMI purposes. XML, on the other hand, can be used for all XML applications, including XMI.

What is XMI used for?

XML Metadata Interchange (XMI) is a standard for exchanging metadata information via XML. XMI is most commonly used as an interchange format for UML models using XML. It can be used for metadata of which the meta-model may be expressed in Meta Object Facility (MOF).


2 Answers

I don't think what you want exists. All tools importing XMI that I know (including my XMI transformation service: http://modeling-languages.com/content/xmi2-tool-exchanging-uml-models-among-case-tools) work by parsing the whole XMI file and creating the corresponding UML model in main memory. Then you can access to the UML elements by querying the model.

To iterate on the XMI model you can easily use XML libraries to select the pieces of the XMI file you are interested in.

like image 147
Jordi Cabot Avatar answered Sep 19 '22 08:09

Jordi Cabot


Maybe simply have a look at Transforming XMI to HTML. This should help you to get started with XSLT and XMI.

like image 36
Pascal Thivent Avatar answered Sep 20 '22 08:09

Pascal Thivent