Visio Guy

Visio Discussions => Programming & Code => Topic started by: Cayle on November 13, 2008, 06:12:07 PM

Title: Extracting Visio XML Document Info For Use in a Custom XML File
Post by: Cayle on November 13, 2008, 06:12:07 PM
Hi all and greetings,  I've been subscribing to the RSS feed Visio Guy's blog for a while, but only ran across the forum tonight while googling about my problem.  I was wondering if someone could give me a tip or two on where to get started. 

I'm building a design tool for virtual worlds.  I have a custom XSD schema for an XML file.  I also have a couple of stencils for graphing that data.  The correlation between XML elements and shapes is pretty close to 1:1, so translating from one to the other should not be difficult.  Currently, I use the stencils to graph a given design and then use it as a graphical aid to hand craft the XML fie in a text editor.  I consistently use certain concepts in my shapes.

Now I'd like to be able to export directly to this XSD from a diagram.  The problem is that looking at .vxd files and XML reports, it is not clear to me what the real hierarchy is.  What I need to do is:

I don't mind writing a script that filters the XML (.vdx file) directly, or using BVA from within Visio.  Does anyone have any tips for finding such information?
Title: Re: Extracting Visio XML Document Info For Use in a Custom XML File
Post by: Visio Guy on November 13, 2008, 09:14:01 PM
Hi Cayle,

You can find the shapes under each page node, like this:

/Pages/Page/Shapes...

In Visio, a group is simply a shape that contains more shapes. So you could look for Shape nodes that contain more Shape nodes.

But even more easily, there is a Type attribute on Shape nodes. For groups, Type="Group" !

That should get you started.

Title: Re: Extracting Visio XML Document Info For Use in a Custom XML File
Post by: Albert on November 13, 2008, 09:18:08 PM
Documentation of Visio XML:
http://msdn.microsoft.com/en-us/library/aa721908.aspx (Visio2007)
http://msdn.microsoft.com/en-us/library/aa176908(office.11).aspx (Visio 2003)
http://xml.coverpages.org/DatadiagramML-200403.pdf (DatadiagramML)



Title: Re: Extracting Visio XML Document Info For Use in a Custom XML File
Post by: Visio Guy on November 13, 2008, 10:24:44 PM
Notes and downloads from my talk at the 2006 Visio Conference:

Visio and Xml Conference Resources (http://www.visguy.com/2006/11/30/visio-and-xml-conference-resources)
Title: Re: Extracting Visio XML Document Info For Use in a Custom XML File
Post by: Cayle on November 14, 2008, 11:36:26 AM
Quote from: Visio Guy on November 13, 2008, 10:24:44 PM
Notes and downloads from my talk at the 2006 Visio Conference:

Visio and Xml Conference Resources (http://www.visguy.com/2006/11/30/visio-and-xml-conference-resources)

Thank You SOOOOOOOO much!  Your presentation does more for my understanding in an hour than days of reading and googling alone did.
Title: Re: Extracting Visio XML Document Info For Use in a Custom XML File
Post by: Visio Guy on November 14, 2008, 11:59:44 AM
Oh my God, did you actually watch it? :) :)

I forgot the whole thing was still "on tape". Makes me cringe to listen to myself, haha!
Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 59 (show)
Files included: 25 - 925KB. (show)
Memory used: 752KB.
Tokens: post-login.
Cache hits: 8: 0.00102s for 22,291 bytes (show)
Cache misses: 3: (show)
Queries used: 12.

[Show Queries]