Extracting Visio XML Document Info For Use in a Custom XML File

Started by Cayle, November 13, 2008, 06:12:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cayle

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.

  • A shape assigned to be a title bar for an object.
  • A set of attached shapes.  The shape data is heavily used and carried the relevant design data.  These are stacked (bottom inward connector attached to an outward connector on the next shape.)
  • A plain, unfilled rectangle that I use as a border.
  • This borderis not attached.  I only overlay geometry, but I do group the border shape, title bar shape and data shapes into a group.
  • I use connectors to define relationships between groups.

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:

  • Find the groups.
  • Within a group, find the title shape.  This tells me what "object" I'm dealing with. 
  • Find the property shapes and read in their values.
  • Find the frame shape.
  • Find connectors attached to the frame shape and follow them to the other end. 

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?

Visio Guy

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.

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010


Visio Guy

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Cayle

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

Thank You SOOOOOOOO much!  Your presentation does more for my understanding in an hour than days of reading and googling alone did.

Visio Guy

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!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 267 (show)
Files included: 34 - 1321KB. (show)
Memory used: 1133KB.
Tokens: post-login.
Cache hits: 12: 0.00182s for 26,583 bytes (show)
Cache misses: 1: (show)
Queries used: 15.

[Show Queries]