Visio 2003 Developer's Survival Pack Tools and Samples

Chapter 28: XML
Visio 2003 DSP home   This page

Overview

Folder Description
SolutionXML Simply provides the sample document with the SolutionXML data as discussed in the book. It's useful to inspect this with XML Browser.
Msxml\xml_view Sample application described in the book demonstrating how to use MSXML parser to read a Visio XML file, find some nodes of interest, and create an HTML report output. Also includes an XSL way of doing the same thing.
Msxml\xml_gen Shows how to use MSXML parser to read a "base" Visio XML file, and add custom data (eg: shapes and connectors).
XMLEmitIndents.reg See note below on XMLEmitIndents

Note: please see the general Notes on Visual Basic 6 Samples before proceeding!

Use With Visio 2003: Important Note on XMLEmitIndents

By default, Visio 2003's VDX save creates "compact" XML that omits indents and linebreaks. This is hard to read in a text editor and in XML Browse. To get Visio 2003 to output sensibly formatted XML, set registry setting XMLEmitIndents to "1":

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Visio\Application]
"XMLEmitIndents"="1"

xml_view, msxmltest.vbp

You can run the already compiled demo program, but running in the VB environment in conjunction with inspecting the source code is probably more informative. The demo has four buttons, which function as follows:

In addition, file MyBasicDocHTM.htm contains HTML code which instructs a browser (Internet Explorer at least!) to feed the vdx and xsl files to the XML parser and produce a report equivalent to the one demoed in the VB sample code.

xml_gen

This sample represents scenarios where you want to generate Visio documents programmatically without using Visio itself. Examples include web servers responding to user requests by generating drawings on the fly.  This sample has a single button that runs the process.  The code loads a base document, and embellishes it with some specific shapes. Of some interest is the demonstration that you don't have to write all the glue formulas to get connectors to glue -- you can just supply minimal Connects data.


Article Created: 2003-09-01  Last edit: Last edit: 03-10-29 Graham Wideman
Go to:
  DiagramAntics.com