Ads
Links
Microsoft Visio UML to XMI export
UPDATE: If you are interested in importing Visio UML class diagrams in other tools as ArgoUML, Poseidon or Eclipse UML2 or in visualizing them online check out my XMI transformation service
Microsoft Visio 2003 included a XMI Export component to export UML models to XMI-compliant files.
However this was not possible in Microsoft Visio 2007 until now with the recent release of the Microsoft Visio Service Pack 2 that contains a new version of the XMI Export component (instructions below)
Although I think it is very positive that Visio offers some kind of XMI export support, my first impression is not very optimistic: the generated XMI is too verbose, it seems that only class diagram elements are exported (as happened with Visio 2003) and more surprisingly, the XMI export is language-dependent!! (that is, the XMI file presents small differences depending on the user predefined language).
For instance, to indicate that an association end it is not an aggregation, Visio would generate the following XML Element for Spanish Visio users:
- Foundation.Core.AssociationEnd.aggregation xmi.value="ninguno"
but this would be the XML element generated for English users:
- Foundation.Core.AssociationEnd.aggregation xmi.value="none"
As an example, this is the Visio XMI file (more than 500k!) corresponding to this simple UML model:
Activating the XMI export component is not an easy task either. Thanks to the help I've found in the Visio Insights msdn blog , I've managed to find out that the process is the following. After installing the SP2, go to "Tools->Macros->Open the Visual Basic Editor" and write and execute the following code:
Sub ExportXMI()
Application.Addons("UML Background Add-on").Run ("/CMD=400 /XMIFILE=""C:\file.xmi""")
End Sub
If you enjoyed the post you can subscribe to this Modeling blog and/or follow me on twitter
And if you really liked it help me pass it on to others by bookmarking and sharing the post using the links below:

Delicious
Digg
StumbleUpon
Reddit
Facebook
Google
Yahoo
Technorati
What about import?
Ok, I have managed to export my model. Edit it in another UML tool. Now I want to import back into Visio.
Les. lmunday@gmail.com
no import in visio
unfortunately this is not possible since Visio does not offer an import functionality
Looked into the XMI file
Thanks for posting the file - saved me the hassle of generating one.
It's quite different from the XMI produced by the previous add-on (which bizarrely claimed to be UML 1.2 - a revision of UML that never officially saw the light of day).
As you point out it is unusually verbose - due partly to the use of XML elements rather than XML attributes for absolutely every value including xmi.id.
However the huge size of the file is due to the presence of a Subsystem element called "Sistema 1 de UML" which contains a large number of 'standard' Stereotype definitions and datatype definitions for 4 different programming languages (IDL, C++, C#, VB - surprise surprise no Java). Removing this subsystem (which would be identical for ANY model) takes the size down to 42Kb!
Also, each Class in your model has 5 tagged values applied: (sematica, persistencia, ubicacion, documentacion, responsilitad) (Attributes have just the last 2) even though they have no values. And that's a general theme - lots of empty elements unnecessarily included. And default values likewise.
One bug I noticed - multiplicity is serlaized as * rather than as 2 separate values lower=0 and upper = -1 (the convention for * at UML 1.x).