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.
Right-click on the XMI file, and select "Open With" from the pop-up menu.
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.
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).
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.
Maybe simply have a look at Transforming XMI to HTML. This should help you to get started with XSLT and XMI.
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