Wednesday, June 09, 2004

Visio to anything

Problem statement:

Couple of weeks back i got myself actively involved with the design team and realized that most of the time was spent in getting the class diagrams from Visio (modelling tool) and stored procedures documented as per the custom design document template.

Technologies
  • Visio,
  • .NET Office Extensibility Add-in,
  • MS Word,
  • VBA,
  • XMI,
  • XSL,
  • CSS

Approach:

Visio does provide a reporting add-in but unfortunately it is neither readable nor is it customizable and so started the thought to work on an alternative.

Microsoft always has a means to automate/customize/extend their products and so do they have UML to XMI Export Functionality, meaning a Visio UML Model can be exported to XML Metadata Interchange (XMI) format. This is build using .NET Office extensibility Add-in.

Now the XMI that is generated by Visio uses UML.dtd, which unfortunately is not distributed by Microsoft but have provided the resource in the readme.txt. With XMI & DTD in place i am sure of a valid Visio XMI file.

The next step was to display the XMI data in a custom format and the best alternative was to use eXtensible Stylesheet Language (XSL), now I needed to understand the structure of Visio XMI file and this is a tough job because there is no documentation available whatsoever to understand how visio model is interpretted in XMI format.

Attached a CSS to XSL to apply the formatting styles including header styles.

The next step was to place this information at an appropriate postion with in the design document template, hence created a .dot file, which is a template file for word.

Created a macro in word VBA that will use MSXML 2.0/4.0 and dynamically translate XMI with XSL and insert it into appropriate position.

Rebuild the table of contents, which will now include the design headings as defined by the CSS.

Please do drop me a comment if you need the UML to XMI add-in/DTD/XSL/CSS/DOT.

4 comments:

Anonymous said...

Hello, can you send me DTD for XMI exported by Visio2003? Please send it to pokemonina@gmail.com

Dr. Amith Ellur said...

I am extremely sorry, I do not have it anymore. I will try to look for it in the backs up and if I can locate it, I will email you.

Apologies...

Dr. Amith Ellur said...

This could be helpful to track the dtd file - http://msdn2.microsoft.com/en-us/library/aa140339(office.10).aspx

Nah said...

Do you have any tips for how to get the UML to XMI Export tool to work? I installed it per Microsoft’s directions (dropped the .dll file into the visio install dir) but it still isn’t showing up in the Tools>Add-Ons>Run Add-On list. Is there another step that is needed? Any help would be greatly appreciated!