Visio XML to HTML

M

MRAW

Hi,

I have a Visio drawing which I save as an XML Drawing file (.vdx). I want to
extract the data stores in the Shape Properties of the .vdx file and use it
to populate a table on a .html file. After reading up a little I found out
that I can use and XSLT transform to map into another schema. Further
investigation revealed that there is also a SolutionXML approach that was
introduced to ease this process. I was hoping somebody could provide me with
some input on whether this is the best approach to follow and if there is any
reference documentation available out there
 
D

David Parker

If you SaveAs web, then you will find that all the shape properties are in
the generated data.xml file.
This will be much easier to transform than the vdx file...
 
M

MRAW

Hi David,

Thanks for the reply. I looked at the data.xml file, it does look a lot
easier to handle compared to the .vdx file. So, next step would be to create
a .xsl stylesheet for this .xml file. I am new to xml so my questions are
very basic (and probably incorrect) at this point. Also, do you know what are
the advantages OR disadvantages of taking this approach as compared to
..vdx>xslt approach
Thanks again,
 
A

Al Edlund

are your drawing automated or manually created? If automated it might be
just as easy to go back to the source data. Are you going to use the
graphics from the drawing in the web-site, or just the data from the
objects? If you are going to use the drawings then saving as a web might
save you the addional step of saving as xml. If you're going to spend a lot
of time with xml you might want to investigate the Altova products.
al
 
M

MRAW

I am drawing manually, mainly using process and decision blocks. However, the
process blocks that I use are going to have modified Custom Properties. I
want to extract the data stored in these blocks and display them along with
the drawing on a html page. The drawing doesn't have to be interactive. So to
summarize I want a web page that lets me select the drawing I want to view
and then extracts the data stored in the shapes and displays it in a table.

Thanks, look forward to your further input
 
D

David Parker

Actually, you can do this in Visio by creating reports (Tools / Reports) to
extract your custom properties, and then include them in your SaveAsWeb by
Publishing the reports with the diagram...
You will end up with extra tables in the mini web-site
 
M

MRAW

Thanks for the suggestion. However, I am still trying to create an XML Parser
to do the same. The SaveAsWeb option creates a subfolder with all the
required files which I would like to avoid.
Below is the data.xml code which I am trying to develop a parser for. As you
can see there are 2 process blocks, each with their associated Cost values, I
am having difficulty extracting the 'Value' ($10, $20) stored in this 'Cost'
elements and displaying them in a HTML table. I am using the
getElementsByTagName method.
I could post my code if required, but my approach might be entirely wrong.
----------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<VisioDocument>
<DocumentProperties>
<Title>Testing Visio to XML Conversion</Title>
<HyperlinkBase href=""></HyperlinkBase>
</DocumentProperties>
<Pages>
<Page ID="0" Name="Page-1" NameU="Page-1">
<Layer IX="0">
<Name>Flowchart</Name>
<NameUniv></NameUniv>
<Visible>1</Visible>
</Layer>
<Value Unit="STR">0.0000</Value>
<Label></Label>
<Shapes>
<Shape ID="1" UniqueID="{3ED7ACA7-B88A-4413-BB3C-FE8D0B76DBDC}"
Name="Process" NameU="Process">
<Text>Process 1 </Text>
<XForm>
<PinX Unit="IN_F">2.117125694444445</PinX>
<PinY Unit="IN_F">8.079724305555558</PinY>
</XForm>
<LayerMem>
<LayerMember>0</LayerMember>
</LayerMem>
<Prop ID="1" Name="Cost" NameU="Cost">
<Value Unit="STR">$10.00</Value>
<Label>Cost</Label>
</Prop>
<Prop ID="2" Name="Duration" NameU="Duration">
<Value Unit="STR">10</Value>
<Label>Duration</Label>
</Prop>
<Prop ID="3" Name="Resources" NameU="Resources">
<Value Unit="STR">1</Value>
<Label>Resources</Label>
</Prop>
</Shape>
<Shape ID="2" UniqueID="{64A09AC8-136C-4E64-97E4-A457E433D608}"
Name="Process.2" NameU="Process.2">
<Text>Process 2</Text>
<XForm>
<PinX Unit="IN_F">3.757874305555554</PinX>
<PinY Unit="IN_F">8.079724305555555</PinY>
</XForm>
<LayerMem>
<LayerMember>0</LayerMember>
</LayerMem>
<Prop ID="1" Name="Cost" NameU="Cost">
<Value Unit="STR">$20.00</Value>
<Label>Cost</Label>
</Prop>
<Prop ID="2" Name="Duration" NameU="Duration">
<Value Unit="STR">20</Value>
<Label>Duration</Label>
</Prop>
<Prop ID="3" Name="Resources" NameU="Resources">
<Value Unit="STR">2</Value>
<Label>Resources</Label>
</Prop>
</Shape>
</Shapes>
</Page>
</Pages>
</VisioDocument>
---------------------------- end of
data.xml------------------------------------------------

Appreciate the all the help,
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top