VDXtoSVG logo

VDX to SVG Translation with XSLT

What is VDX?

VDX is MicrosoftTM's XML language for VisioTM drawings, introduced in Visio 2002.  This isn't just an export format; all of the drawing features are stored in the file, allowing it to be used in place of Visio's native binary format.  Microsoft documentation on VDX, including the schema, is available here.

What is SVG?

SVG is a W3C-standard XML language for two-dimensional vector graphics and mixed vector/raster graphics [1].  It includes animation based on the SMIL 1.0 specification.  It also supports some very powerful 2D filter elements, for creating special effects such as the ubiquitous drop shadow.  The authoritative source of all things SVG is the W3C site.

What is XSLT?

XSLT is a W3C-standard XML language for translating one XML language to another.  It can be used as a bridge from abstract, special-purpose XML languages, such as a user might create for an inventory database, to presentation-oriented XML languages such as XHTML and SVG [technically speaking, XSLT is only one part of the XSL language].

What is VDXtoSVG?

VDXtoSVG is a SourceForge project to create an XSLT spreadsheet that can translate VDX files to SVG.  More specifically, the project has the following goals:
The project page can be found here.

Sounds great!  How do I use it?

First of all, you need a Visio drawing saved in VDX format.  The only way I know of to do this is to use Visio 2002 (if anyone knows of another way, such as a command-line converter, please let me know).

Second, you need an SVG viewer.  The most capable free viewer at this time is Adobe's.  Unfortunately, it's only officially available for Windows and Mac OS X (there is a beta 3.0 version for Linux and Solaris in the archives).  The Adobe viewer also does not work well with the latest Mozilla builds, due to interface changes.

The second most popular free viewer is probably Squiggle, part of the Batik toolkit from the Apache XML Project.  Unfortunately, it doesn't currently handle animation, and has limited script support.

Other viewers are listed on the W3C SVG page.

Finally, you need an XSLT processor to "execute" the stylesheet.  Here are just a few of the ones available:
SAXON is used for development and testing of VDXtoSVG.  Although the goal is to not require the use of any particular XSLT processor, there are some features that will be fully functional only if the processor supports certain extensions (e.g., access to a math library).  Since SAXON is used for development, it will be the first one supported.

An extensive list of processors can be found here.

Downloading and Installation
The latest release (and some number of previous releases) can be found here.  Currently, the releases are gzipped tar files (I'll entertain changing to zip files if there is sufficient interest).
You can also access the CVS repository directly, if you prefer.

To install the release, simply untar the release file in whatever directory you wish (all files will be in a subdirectory named vdxtosvg).

The steps required to translate a VDX file to SVG varies with each XSLT processor.  For example, to translate the file basic_tests.vdx (included in the release) to basic_tests.svg, SAXON would require a command line like this:

java -jar saxon-install-path/saxon.jar -o basic_tests.svg basic_tests.vdx vdxtosvg-install-path/visio.xsl

I've been wondering if people would like to see a web-based service for trying out the translator on their own Visio files.  If you have a SourceForge account, please take the survey (if you don't, feel free to leave comments in the forum, or email me).

Here are some samples of the conversion:

This demonstrates basic shapes and some simple animation:
Basic Tests
Visio VDX file
SVG file

Text alignment tests:
Text tests
Visio VDX file
SVG file

An example sequence diagram:
Sequence Test
Visio VDX file
SVG file

Full-blown animation:
Animation tests
Visio VDX file
SVG file

SourceForge Logo

$Id: index.html,v 1.10 2002/07/22 18:45:07 jabreen Exp $