说明: This archieve contains two versions of xslt tables to convert VISIO XML files to SVG. This files should be usefull to those who makes converters to SVG as illustration.
Notes for vdxtosvg XSLT stylesheet:
WHAT'S NEW FOR VERSION 1.5:
==========================
Two main changes:
a) NURBS curves are now translated to Beziers. There are a few
limitations, though: only 3rd-degree curves are supported, they
can not have repeating knots (except at the endpoints, of course), and
all weights must be 1 (i.e., non-rational). This appears to be what
Visio's freehand tool creates, so it shouldn't be a problem unless
you're creating curves another way (e.g., via ShapeSheet changes).
b) All predefined patterns are implemented. However, pattern 9 (fine
crosshatch) doesn't display correctly on Batik, although it does on
Adobe's SVG Viewer (ASV). It appears to be a difference in
interpretation of x/y positioning and scaling, but I haven't worked
out yet who is right. If you use Batik and you need this, contact me
and I'll tell you how to change it so it will work (but then it won't
be correct in ASV).
A few bugs have been corrected, most importantly a bug in the text
wrapping script that caused the last word to wrap when it didn't need
to. See the ChangeLog for details.
Finally, this may be my last release for a while. I'm losing my job
on Aug 16 2002, and although I've got a pretty good chance at getting
another job soon, they don't use Visio 2002. I'll probably handle
feature requests if you send me a VDX file to use as a test case. And
of course I'll accept patches (but still send a test case if the patch
adds new functionality, so I can add it to my regression tests).
INTRODUCTION:
============
Microsoft's Visio (tm) 2002 added the capability to read and write
Visio drawings in XML format. These drawings are identified by the
extension ".vdx". However, this is purely a data format. The
graphics data is all there, but not in a standard graphics format.
SVG (Scalable Vector Graphics) is a W3C Recommendation for describing
two-dimensional graphics in XML. It supports most of the constructs
used in Visio, plus a number of advanced features, like animation.
XSLT is the link between the two. An XSLT stylesheet (which is also
written in XML) specifies the translation from one XML language/format
to another. An XSLT processor takes the stylesheet and the input XML
file, and produces the output file.
The goals of this project are:
(a) develop an XSLT stylesheet to translate Visio's VDX format to SVG,
with the resulting drawing being as close as possible - both visually
and structurally - to the original.
(b) develop Visio templates/stencils/masters and methodologies to
allow SVG-specific constructs (like animation) to be easily and
intuitively added to a drawing.
USAGE:
======
The stylesheet has been broken up into multiple files to try to keep
things modular and organized. All are required to be in the same
directory.
This requires a Microsoft Visio file that has been saved in VDX
format. AFAIK, this is only possible under Visio 2002; I don't know
for certain if it's available in the Standard Edition (I have the
Professional). The good thing is, Visio 2002 also reads VDX, so you can
use it as the native drawing format (i.e., you don't need to keep two
copies of the drawing).
To use it, you either need to explicitly convert the VDX file to SVG
with an XSLT processor, or have the browser do it on-the-fly. For
example, with a Saxon installation, the command:
java -jar ~/install/saxon/saxon.jar -o basic_tests.svg \
basic_tests.vdx visio.xsl
will translate basic_tests.vdx into basic_tests.svg.
To do it via the browser, [Insert instructions and details for
on-the-fly conversion].
Top-level Parameters
--------------------
Currently, there are two top-level parameters that can be used to
change the behavior of the translation:
pageNumber: this parameter specifies the page number of the Visio
drawing that is to be translated. The default is 1 (the first page).
userScale: this parameter specifies the scale between Visio's units
and the SVG user units. The default is 100.
[Note: this was added because of some strange behavior I saw when the
scales were the same. I assumed it was due to numerical problems with
small numbers, but later tests indicate that it may have been due to
the lack of a default viewBox on the outermost