TinyButStrong - the PHP Template Engine
Categories > OpenTBS general MsOffice >

I need to make a xml template that will create a VDX

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Partialdata
Date: 2014-08-13
Time: 01:10

I need to make a xml template that will create a VDX

TBS can create docx! I need to create a vdx for visio.  I currently do visualizations in my web application based on the D3.js framework. I can export these visualizations (force directed graphs and trees) to SVG format easily, but I would like to export them into a Visio format and have the connections stay anchored to the device objects. I am looking for away to write the code necessary to grab the X,Y coordinates of the Nodes and Links and export them as connected pairs to the Microsoft Visio XML format.(VDX) can TBS help do this?

here is my test data. http://www.partialdata.com/public_html/index.php  Give a few to load the map. I would like to export that to VDX

Thank you for your time
By: Skrol29
Date: 2014-08-13
Time: 01:35

Re: I need to make a xml template that will create a VDX

I don't have Visio, could you sent to me an example of VDX ?
By: Partialdata
Date: 2014-08-13
Time: 01:41

Re: I need to make a xml template that will create a VDX

the only place that is currently doing export to vdx is lucidcharts  check out the link its what makes up the vdx file that file you can just save it as a .xml or .vdx if you can get your hands on visio or sign up for a free trial at lucidcharts you can import that vdx and see it as a visio document. here is a screen shot of what it looks like

http://imgur.com/u3ubEjg


and here is what the xml looks like to make up that vdx file.
http://pastebin.com/0qv5WFC3

thank you!
By: Skrol29
Date: 2014-08-13
Time: 01:49

Re: I need to make a xml template that will create a VDX

Hi,
A .vdx is a single XML file ?
By: Partialdata
Date: 2014-08-13
Time: 19:50

Re: I need to make a xml template that will create a VDX

Yes 
By: Skrol29
Date: 2014-08-14
Time: 00:52

Re: I need to make a xml template that will create a VDX

Then it is quite easy to merge a VDX with TBS.
You have to use TBS alone, that is without OpenTBS.

First build a basic VDX with Visio. This basic VDX should have a the characteristics of your target VDX but with a simple sample of data.
Then create your TBS template by editing your basic VDX with a text editor and place the TBS fields inside.

Then you can merge it with TBS.
By: Partialdata
Date: 2014-08-14
Time: 00:56

Re: I need to make a xml template that will create a VDX

I do not understand how i would do this using tbs

here is what a vdx looks like  can you please show me an example with my data?
http://pastebin.com/0qv5WFC3
By: Skrol29
Date: 2014-08-14
Time: 01:04

Re: I need to make a xml template that will create a VDX

What are your data ?
By: Partialdata
Date: 2014-08-14
Time: 01:14

Re: I need to make a xml template that will create a VDX

I have pasted a link to the pastebin site where the vdx xml file is can you see this --> http://pastebin.com/0qv5WFC3   if not i have pasted the whole thing in here

   
<?xml version="1.0" encoding="utf-8"?>
<VisioDocument>
        <Masters>
                <Master ID="2051" Name="ProcessBlock" NameU="com.lucidchart.ProcessBlock21">
                        <Shapes>
                                <Shape ID="5" Type="Group">
                                        <XForm>
                                                <Width>1.0</Width>
                                                <Height>0.75</Height>
                                                <PinX>4.375</PinX>
                                                <PinY>8.875</PinY>
                                                <LocPinX F="Width*0.5">0.5</LocPinX>
                                                <LocPinY F="Height*0.5">0.375</LocPinY>
                                                <Angle>-0.0</Angle>
                                        </XForm>
                                        <TextXForm>
                                                <TxtWidth F="Width*1.0">1.0</TxtWidth>
                                                <TxtHeight F="Height*1.0">0.75</TxtHeight>
                                                <TxtPinX F="Width*0.5">0.5</TxtPinX>
                                                <TxtPinY F="Height*0.5">0.375</TxtPinY>
                                                <TxtLocPinX F="TxtWidth*0.5">0.5</TxtLocPinX>
                                                <TxtLocPinY F="TxtHeight*0.5">0.375</TxtLocPinY>
                                                <TxtAngle>-0.0</TxtAngle>
                                        </TextXForm>
                                        <Fill>
                                                <FillForegnd>#000000</FillForegnd>
                                                <FillBkgnd>#000000</FillBkgnd>
                                                <FillForegndTrans>1.0</FillForegndTrans>
                                                <FillBkgndTrans>0.0</FillBkgndTrans>
                                                <FillPattern>1</FillPattern>
                                        </Fill>
                                        <Line>
                                                <LineWeight>0.0125</LineWeight>
                                                <LineColor>#000000</LineColor>
                                                <LinePattern>1</LinePattern>
                                                <BeginArrow F="">0</BeginArrow>
                                                <EndArrow F="">4</EndArrow>
                                                <Rounding>0.003125</Rounding>
                                        </Line>
                                        <Protection>
                                                <LockGroup>1</LockGroup>
                                        </Protection>
                                        <Group>
                                                <DontMoveChildren>0</DontMoveChildren>
                                        </Group>
                                        <Event>
                                                <EventDblClick F="OpenTextWin()"/>
                                        </Event>
                                        <Char IX="0">
                                                <Color>#000000</Color>
                                                <Font>Arial</Font>
                                                <Size>0.1111111111111111</Size>
                                                <Style>0</Style>
                                                <Strikethru>0</Strikethru>
                                        </Char>
                                        <Para IX="0">
                                                <IndFirst>0.0</IndFirst>
                                                <IndLeft>0.0</IndLeft>
                                                <IndRight>0.0</IndRight>
                                                <SpLine Unit="DT">-1.0</SpLine>
                                                <SpBefore>0.0</SpBefore>
                                                <SpAfter>0.0</SpAfter>
                                                <HorzAlign>1</HorzAlign>
                                                <Bullet>0</Bullet>
                                        </Para>
                                        <Connection IX="0">
                                                <X F="Width*0.0">0.0</X>
                                                <Y F="Height*0.5">0.375</Y>
                                        </Connection>
                                        <Connection IX="1">
                                                <X F="Width*1.0">1.0</X>
                                                <Y F="Height*0.5">0.375</Y>
                                        </Connection>
                                        <Connection IX="2">
                                                <X F="Width*0.5">0.5</X>
                                                <Y F="Height*0.0">0.0</Y>
                                        </Connection>
                                        <Connection IX="3">
                                                <X F="Width*0.5">0.5</X>
                                                <Y F="Height*1.0">0.75</Y>
                                        </Connection>
                                        <Shapes>
                                                <Shape ID="6" Type="Shape">
                                                        <XForm>
                                                                <Width F="Sheet.5!Width*1">1.0</Width>
                                                                <Height F="Sheet.5!Height*1">0.75</Height>
                                                                <PinX F="Sheet.5!Width*0.5">0.5</PinX>
                                                                <PinY F="Sheet.5!Height*0.5">0.375</PinY>
                                                                <LocPinX F="Width*0.5">0.5</LocPinX>
                                                                <LocPinY F="Height*0.5">0.375</LocPinY>
                                                                <Angle>0.0</Angle>
                                                        </XForm>
                                                        <Fill>
                                                                <FillForegnd F="GUARD(TINT(Sheet.5!FillForegnd,224))">#000000</FillForegnd>
                                                                <FillBkgnd F="Sheet.5!FillBkgnd">#000000</FillBkgnd>
                                                                <FillForegndTrans F="Sheet.5!FillForegndTrans">1.0</FillForegndTrans>
                                                                <FillBkgndTrans F="Sheet.5!FillBkgndTrans">0.0</FillBkgndTrans>
                                                                <FillPattern F="Sheet.5!FillPattern">1</FillPattern>
                                                        </Fill>
                                                        <Line>
                                                                <LineWeight F="Sheet.5!LineWeight">0.0125</LineWeight>
                                                                <LineColor F="Sheet.5!LineColor">#000000</LineColor>
                                                                <LinePattern F="Sheet.5!LinePattern">1</LinePattern>
                                                                <BeginArrow F="Sheet.5!BeginArrow">0</BeginArrow>
                                                                <EndArrow F="Sheet.5!EndArrow">4</EndArrow>
                                                                <Rounding F="Sheet.5!Rounding">0.003125</Rounding>
                                                        </Line>
                                                        <Protection>
                                                                <LockHeight>1</LockHeight>
                                                                <LockWidth>1</LockWidth>
                                                                <LockMoveX>1</LockMoveX>
                                                                <LockMoveY>1</LockMoveY>
                                                                <LockRotate>1</LockRotate>
                                                                <LockTextEdit>1</LockTextEdit>
                                                        </Protection>
                                                        <Group/>
                                                        <Event/>
                                                        <Geom IX="0">
                                                                <NoFill>0</NoFill>
                                                                <NoLine>0</NoLine>
                                                                <NoShow>0</NoShow>
                                                                <MoveTo IX="1">
                                                                        <X F="Width*0.0">0.0</X>
                                                                        <Y F="Height*0.9584">0.7188</Y>
                                                                </MoveTo>
                                                                <NURBSTo IX="2">
                                                                        <X F="Width*0.0313">0.0313</X>
                                                                        <Y F="Height*1.0">0.75</Y>
                                                                        <A>0.0</A>
                                                                        <B>1.0</B>
                                                                        <C>0.0</C>
                                                                        <D>1.0</D>
                                                                        <E Unit="NURBS">NURBS(1.0,3,0,0,0.0,0.9817,0.0,1.0,0.0138,1.0,0.0,1.0)</E>
                                                                </NURBSTo>
                                                                <LineTo IX="4">
                                                                        <X F="Width*0.9688">0.9688</X>
                                                                        <Y F="Height*1.0">0.75</Y>
                                                                </LineTo>
                                                                <NURBSTo IX="5">
                                                                        <X F="Width*1.0">1.0</X>
                                                                        <Y F="Height*0.9584">0.7188</Y>
                                                                        <A>0.0</A>
                                                                        <B>1.0</B>
                                                                        <C>0.0</C>
                                                                        <D>1.0</D>
                                                                        <E Unit="NURBS">NURBS(1.0,3,0,0,0.9862,1.0,0.0,1.0,1.0,0.9817,0.0,1.0)</E>
                                                                </NURBSTo>
                                                                <LineTo IX="7">
                                                                        <X F="Width*1.0">1.0</X>
                                                                        <Y F="Height*0.04173333333333334">0.0313</Y>
                                                                </LineTo>
                                                                <NURBSTo IX="8">
                                                                        <X F="Width*0.9688">0.9688</X>
                                                                        <Y F="Height*0.0">0.0</Y>
                                                                        <A>0.0</A>
                                                                        <B>1.0</B>
                                                                        <C>0.0</C>
                                                                        <D>1.0</D>
                                                                        <E Unit="NURBS">NURBS(1.0,3,0,0,1.0,0.0183,0.0,1.0,0.9862,0.0,0.0,1.0)</E>
                                                                </NURBSTo>
                                                                <LineTo IX="10">
                                                                        <X F="Width*0.0313">0.0313</X>
                                                                        <Y F="Height*0.0">0.0</Y>
                                                                </LineTo>
                                                                <NURBSTo IX="11">
                                                                        <X F="Width*0.0">0.0</X>
                                                                        <Y F="Height*0.04173333333333334">0.0313</Y>
                                                                        <A>0.0</A>
                                                                        <B>1.0</B>
                                                                        <C>0.0</C>
                                                                        <D>1.0</D>
                                                                        <E Unit="NURBS">NURBS(1.0,3,0,0,0.0138,0.0,0.0,1.0,0.0,0.0183,0.0,1.0)</E>
                                                                </NURBSTo>
                                                                <LineTo IX="13">
                                                                        <X F="Width*0.0">0.0</X>
                                                                        <Y F="Height*0.9584">0.7188</Y>
                                                                </LineTo>
                                                        </Geom>
                                                </Shape>
                                        </Shapes>
                                        <TextBlock>
                                                <VerticalAlign>1</VerticalAlign>
                                        </TextBlock>
                                        <Text>
                                                <pp IX="0"/>
                                                <cp IX="0"/>Awesome</Text>
                                </Shape>
                        </Shapes>
                </Master>
        </Masters>
        <Pages>
                <Page ID="222" Name="New Page">
                        <PageSheet>
                                <PageProps>
                                        <PageWidth>8.5</PageWidth>
                                        <PageHeight>11.0</PageHeight>
                                        <DrawingScale>1.0</DrawingScale>
                                        <PageScale>1.0</PageScale>
                                </PageProps>
                                <PrintProps>
                                        <PageLeftMargin>0.5</PageLeftMargin>
                                        <PageRightMargin>0.5</PageRightMargin>
                                        <PageTopMargin>0.5</PageTopMargin>
                                        <PageBottomMargin>0.5</PageBottomMargin>
                                        <PaperKind>1</PaperKind>
                                        <PrintPageOrientation>1</PrintPageOrientation>
                                        <ScaleX>1.0</ScaleX>
                                        <ScaleY>1.0</ScaleY>
                                </PrintProps>
                        </PageSheet>
                        <Shapes>
                                <Shape ID="1" Master="2051" Name="com.lucidchart.ProcessBlock" NameU="com.lucidchart.ProcessBlock.1" Type="Group">
                                        <XForm>
                                                <Width>1.0</Width>
                                                <Height>0.75</Height>
                                                <PinX>4.375</PinX>
                                                <PinY>8.875</PinY>
                                                <LocPinX F="Width*0.5">0.5</LocPinX>
                                                <LocPinY F="Height*0.5">0.375</LocPinY>
                                                <Angle>-0.0</Angle>
                                        </XForm>
                                        <TextXForm>
                                                <TxtWidth F="Width*1.0">1.0</TxtWidth>
                                                <TxtHeight F="Height*1.0">0.75</TxtHeight>
                                                <TxtPinX F="Width*0.5">0.5</TxtPinX>
                                                <TxtPinY F="Height*0.5">0.375</TxtPinY>
                                                <TxtLocPinX F="TxtWidth*0.5">0.5</TxtLocPinX>
                                                <TxtLocPinY F="TxtHeight*0.5">0.375</TxtLocPinY>
                                                <TxtAngle>-0.0</TxtAngle>
                                        </TextXForm>
                                        <Fill>
                                                <FillForegnd>#80ff00</FillForegnd>
                                                <FillBkgnd>#000000</FillBkgnd>
                                                <FillForegndTrans>0.0</FillForegndTrans>
                                                <FillBkgndTrans>0.0</FillBkgndTrans>
                                                <FillPattern>1</FillPattern>
                                        </Fill>
                                        <Line>
                                                <LineWeight>0.0125</LineWeight>
                                                <LineColor>#000000</LineColor>
                                                <LinePattern>1</LinePattern>
                                                <BeginArrow F="">0</BeginArrow>
                                                <EndArrow F="">0</EndArrow>
                                                <Rounding>0.0</Rounding>
                                        </Line>
                                        <Protection>
                                                <LockGroup>1</LockGroup>
                                        </Protection>
                                        <Group>
                                                <DontMoveChildren>0</DontMoveChildren>
                                        </Group>
                                        <Event>
                                                <EventDblClick F="OpenTextWin()"/>
                                        </Event>
                                        <Char IX="0">
                                                <Color>#000000</Color>
                                                <Font>Arial</Font>
                                                <Size>0.1111111111111111</Size>
                                                <Style>0</Style>
                                                <Strikethru>0</Strikethru>
                                        </Char>
                                        <Para IX="0">
                                                <IndFirst>0.0</IndFirst>
                                                <IndLeft>0.0</IndLeft>
                                                <IndRight>0.0</IndRight>
                                                <SpLine Unit="DT">-1.0</SpLine>
                                                <SpBefore>0.0</SpBefore>
                                                <SpAfter>0.0</SpAfter>
                                                <HorzAlign>1</HorzAlign>
                                                <Bullet>0</Bullet>
                                        </Para>
                                        <Connection IX="0">
                                                <X F="Width*0.0">0.0</X>
                                                <Y F="Height*0.5">0.375</Y>
                                        </Connection>
                                        <Connection IX="1">
                                                <X F="Width*1.0">1.0</X>
                                                <Y F="Height*0.5">0.375</Y>
                                        </Connection>
                                        <Connection IX="2">
                                                <X F="Width*0.5">0.5</X>
                                                <Y F="Height*0.0">0.0</Y>
                                        </Connection>
                                        <Connection IX="3">
                                                <X F="Width*0.5">0.5</X>
                                                <Y F="Height*1.0">0.75</Y>
                                        </Connection>
                                        <Shapes>
                                                <Shape ID="2" MasterShape="6" Type="Shape">
                                                        <XForm>
                                                                <Width F="Sheet.1!Width*1">1.0</Width>
                                                                <Height F="Sheet.1!Height*1">0.75</Height>
                                                                <PinX F="Sheet.1!Width*0.5">0.5</PinX>
                                                                <PinY F="Sheet.1!Height*0.5">0.375</PinY>
                                                                <LocPinX F="Width*0.5">0.5</LocPinX>
                                                                <LocPinY F="Height*0.5">0.375</LocPinY>
                                                                <Angle>0.0</Angle>
                                                        </XForm>
                                                        <Fill>
                                                                <FillForegnd F="Sheet.1!FillForegnd">#80ff00</FillForegnd>
                                                                <FillBkgnd F="Sheet.1!FillBkgnd">#000000</FillBkgnd>
                                                                <FillForegndTrans F="Sheet.1!FillForegndTrans">0.0</FillForegndTrans>
                                                                <FillBkgndTrans F="Sheet.1!FillBkgndTrans">0.0</FillBkgndTrans>
                                                                <FillPattern F="Sheet.1!FillPattern">1</FillPattern>
                                                        </Fill>
                                                        <Line>
                                                                <LineWeight F="Sheet.1!LineWeight">0.0125</LineWeight>
                                                                <LineColor F="Sheet.1!LineColor">#000000</LineColor>
                                                                <LinePattern F="Sheet.1!LinePattern">1</LinePattern>
                                                                <BeginArrow F="Sheet.1!BeginArrow">0</BeginArrow>
                                                                <EndArrow F="Sheet.1!EndArrow">0</EndArrow>
                                                                <Rounding F="Sheet.1!Rounding">0.0</Rounding>
                                                        </Line>
                                                        <Protection>
                                                                <LockHeight>1</LockHeight>
                                                                <LockWidth>1</LockWidth>
                                                                <LockMoveX>1</LockMoveX>
                                                                <LockMoveY>1</LockMoveY>
                                                                <LockRotate>1</LockRotate>
                                                                <LockTextEdit>1</LockTextEdit>
                                                        </Protection>
                                                        <Group/>
                                                        <Event/>
                                                </Shape>
                                        </Shapes>
                                        <TextBlock>
                                                <VerticalAlign>1</VerticalAlign>
                                        </TextBlock>
                                        <Text>
                                                <pp IX="0"/>
                                                <cp IX="0"/>Awesome</Text>
                                        <lc:Property Name="IgnoreTheme" xmlns:lc="http://www.lucidchart.com">[]</lc:Property>
                                        <lc:Property Name="Shadow" xmlns:lc="http://www.lucidchart.com">null</lc:Property>
                                        <lc:Property Name="Hidden" xmlns:lc="http://www.lucidchart.com">0</lc:Property>
                                        <lc:Property Name="Opacity" xmlns:lc="http://www.lucidchart.com">100</lc:Property>
                                        <lc:Property Name="Lock" xmlns:lc="http://www.lucidchart.com">0</lc:Property>
                                        <lc:Property Name="InsetMargin" xmlns:lc="http://www.lucidchart.com">5</lc:Property>
                                        <lc:Property Name="StrokeStyle" xmlns:lc="http://www.lucidchart.com">solid</lc:Property>
                                        <lc:Property Name="TextLinks" xmlns:lc="http://www.lucidchart.com">[]</lc:Property>
                                        <lc:Property Name="BG" xmlns:lc="http://www.lucidchart.com">0</lc:Property>
                                        <lc:Property Name="NoteHint" xmlns:lc="http://www.lucidchart.com"/>
                                        <lc:Property Name="FlipY" xmlns:lc="http://www.lucidchart.com">false</lc:Property>
                                        <lc:Property Name="TextWrap" xmlns:lc="http://www.lucidchart.com">fit</lc:Property>
                                        <lc:Property Name="MinLayerPadding" xmlns:lc="http://www.lucidchart.com">null</lc:Property>
                                        <lc:Property Name="FlipX" xmlns:lc="http://www.lucidchart.com">false</lc:Property>
                                </Shape>
                        </Shapes>
                </Page>
        </Pages>
</VisioDocument>
By: Skrol29
Date: 2014-08-14
Time: 09:44

Re: I need to make a xml template that will create a VDX

Ok, I saw your VDX but I didn't know that was your data.

I can help you on TBS, but I cannot help you to understand the VDX paradigm.
In your VDX, can you tell what part should be dynamic, and what are the new data to get in ?
By: Partialdata
Date: 2014-08-14
Time: 16:50

Re: I need to make a xml template that will create a VDX

Thank you for taking the time to help me get this sorted.

                                    <TextBlock>
                                                <VerticalAlign>1</VerticalAlign>
                                        </TextBlock>
                                        <Text>
                                                <pp IX="0"/>
                                                <cp IX="0"/>Awesome</Text>


what needs to be dynamic is the word "Awesome"  That data will change.  All these elements wont change. These <lc:Property Name="IgnoreTheme" xmlns:lc="http://www.lucidchart.com">[]</lc:Property>  i have no idea what they are doing at this point something lucid implemented.


but these elements you see like VisioDocument, Masters, Master,  Shape, shapes etc... this is all part of the visio 2010 schema and is required. Some of the data that you see between the open and closed tag like my example above with the text being awesome that will change. Some tags will not be dynamic i can sort that out. I just need to see an example of how tbs could be used to construct this xml using dynamic data.