1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
|
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01086432"><META NAME="lcid" CONTENT="1033"><title>Visio Schema Overview</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>Visio Schema Overview</h1><p>Microsoft® Office Visio® 2003 provides an XML vocabulary, or <i>schema</i>, that defines all the XML tags for a Visio document's data elements and attributes and their containment relationships. Software tools and programs that handle XML use the schema to validate XML files.</p><p><p><b>Note</b> In previously published materials, including the Microsoft Office Visio 2003 SDK, the XML schema that is explained in this document was referred to as "XML for Visio." From now on, the schema will be known as DatadiagramML.</p></p><p>A DatadiagramML file, like a Visio drawing (VSD) file, contains document-level containers and hierarchical containers of other containers. Following is a graphical representation of the containment hierarchy of a Visio file.</p><img border="0" src="../img/XML_01.gif" alt="Graphical representation of the containment hierarchy of a Visio file"><p>Representation of containment hierarchy of a DatadiagramML file</p><p>DatadiagramML tags represent the containment hierarchy. The following tags describe the preceding graphic:</p><pre><code><VisioDocument>
...
<StyleSheets>
<StyleSheet>
...
<Masters>
<Master>
<Shapes>
<Shape>
...
...
<Pages>
<Page>
<Shapes>
<Shape>
...
...</code></pre><p> <p><b>Note</b> In practice, the <b class="bterm">StyleSheet</b>, <b class="bterm">Master</b>, <b class="bterm">Shape</b>, and <b class="bterm">Page</b> elements require an <b class="bterm">ID</b> attribute.</p></p><p>The DatadiagramML hierarchy contains two major structures:</p><p><ul>
<li><b class="bterm">The VisioDocument structure</b> The root element of the document structure, <b class="bterm">VisioDocument</b>, and its immediate child elements specify properties of the document as a whole. Many of the elements at this level of the hierarchy correspond to objects and properties exposed in the Visio object model and described in the <a target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/viconAboutAutoRef.asp" id="HV81903454" lcid=" ">Microsoft Office Visio Automation Reference</a>.</li>
<li><b class="bterm">The sheet structure</b> In a Visio file, certain containers represent sheets. A sheet is a collection of cells that specifies properties of the object represented by the sheet. These sheets are commonly referred to in the application as <i>ShapeSheet spreadsheets</i>. In a DatadiagramML file, there are four elements that represent sheets<nbsp />— the <b class="bterm">DocumentSheet</b>, <b class="bterm">PageSheet</b>, <b class="bterm">Shape</b>, and <b class="bterm">StyleSheet</b> elements.<p>Sheets contains cells, each of which has a formula. The cells are organized into rows, and the rows into sections. Most of the elements in the sheet structure correspond to the sections, rows, and cells defined in the <a target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/viconAboutSSRef.asp" id="HV01045900" lcid=" ">Microsoft Office Visio ShapeSheet Reference</a>.</p><p> <p><b>Note</b> Although the DatadiagramML schema allows any type of sheet data in any type of sheet, we recommend that you restrict data to that allowed by the ShapeSheet and Automation interfaces. For instance, the schema allows geometry in a style, but Automation does not. If you supply nonstandard data in an XML file, it might not be fully supported by Visio even if it loads successfully.</p></p></li>
</ul></p>
<p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">VisioDocument structure</a></p>
<div id="ExpCol" class="collapsed" border="0">
<p>The root element of a DatadiagramML document is called <b class="bterm">VisioDocument</b>, and it contains the child elements described in the following table.</p>
<table>
<tr>
<th>
<b class="bterm">VisioDocument child element</b>
</th>
<th>
<b class="bterm">Contains</b>
</th>
</tr>
<tr>
<td>
<p><b class="bterm">DocumentProperties</b></p>
</td>
<td>
<p>Document properties such as the title, author, and so on</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">DocumentSettings</b></p>
</td>
<td>
<p>Document settings such as glue, snap, and so on</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">Colors</b></p>
</td>
<td>
<p>The document's color table</p>
</td>
</tr>
<tr><td><p><b class="bterm">FaceNames</b></p></td><td><p>Information about each of the fonts in the document</p></td></tr><tr>
<td>
<p><b class="bterm">StyleSheets</b></p>
</td>
<td>
<p>A sheet for each style in the document</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">DocumentSheet</b></p>
</td>
<td>
<p>The document's sheet</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">Masters</b></p>
</td>
<td>
<p>The document's masters</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">Pages</b></p>
</td>
<td>
<p>The document's pages</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">Windows</b></p>
</td>
<td>
<p>Descriptions of windows that open when the document opens</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">EventList</b></p>
</td>
<td>
<p>The document's event items</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">HeaderFooter</b></p>
</td>
<td>
<p>Header and footer properties</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">VBProjectData</b></p>
</td>
<td>
<p>A Microsoft Visual Basic for Applications (VBA) project</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">EmailRoutingData</b></p>
</td>
<td>
<p>E-mail routing information</p>
</td>
</tr>
<tr>
<td>
<p><b class="bterm">SolutionXML</b></p>
</td>
<td>
<p>Custom XML for your solution</p>
</td>
</tr>
</table>
<p>The child elements of <b class="bterm">VisioDocument</b> must appear in a DatadiagramML file in the order described in the schema (and in the preceding table). All the child elements of <b class="bterm">VisioDocument</b> do not need to be present in a DatadiagramML file, but if a child element of <b class="bterm">VisioDocument</b> is out of order, Visio displays a warning message when the file is loaded and ignores the contents of the element. </p>
<p>Two of the immediate children of the <b class="bterm">VisioDocument</b> element are hierarchical containers<nbsp />— the <b class="bterm">Masters</b> and <b class="bterm">Pages</b> elements. The <b class="bterm">Masters</b> element contains <b class="bterm">Master</b> elements, and the <b class="bterm">Pages</b> element contains <b class="bterm">Page</b> elements. (Also, each <b class="bterm">Master</b> and <b class="bterm">Page</b> element can contain a <b class="bterm">PageSheet</b> element.)</p>
<p>Each <b class="bterm">Master</b> and <b class="bterm">Page</b> element can contain a <b class="bterm">Shapes</b> element, which contains <b class="bterm">Shape</b> elements. In turn, each <b class="bterm">Shape</b> can have its own <b class="bterm">Shapes</b> collection (for example, a group shape contains a <b class="bterm">Shapes</b> element).</p><pre><code><VisioDocument>
...
<Masters>
<Master>
<Shapes>
<Shape>
...
...
<Pages>
<Page>
<Shapes>
<Shape>
...
...
...
</code></pre>
<p><p><b>Note</b> In practice, the <b class="bterm">Master</b>, <b class="bterm">Shape</b>, and <b class="bterm">Page</b> elements require an <b class="bterm">ID</b> attribute.</p></p>
<p>The order of child elements in the <b class="bterm">Pages</b> and <b class="bterm">Shapes</b> elements has special meaning:</p>
<p><ul>
<li>In the <b class="bterm">Pages</b> element, the order in which the <b class="bterm">Page</b> elements appear determines the order of their appearance in the Visio user interface and in the Automation collections.</li>
<li>In the <b class="bterm">Shapes</b> element, the order in which the <b class="bterm">Shape</b> elements appear determines the display-list order of the shapes. The first <b class="bterm">Shape</b> child element is the shape that has the bottommost z-order.</li>
</ul></p>
<p><a href="vixmlconSchema.htm" id="HV83150831" lcid=" ">View the document hierarchy</a></p>
</div>
<p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Sheet structure</a></p>
<div id="ExpCol" class="collapsed" border="0">
<p>A sheet is a collection of formulas and values that are organized in a spreadsheet-like table and define the appearance and behavior of objects in Visio. These formulas and values are contained in cells, which are organized in groups called rows, which are in turn organized into groups called sections. In the Visio user interface, these sheets are commonly referred to as ShapeSheet spreadsheets.</p>
<p>Cell formulas are expressions that evaluate to numeric or string values and other data types, such as those listed in <a href="vixmlconUnitsOfMeasure.htm" id="HV83150825" lcid=" ">Units of Measure</a>. The formula expressions can contain numeric and string constants, ShapeSheet functions (which are similar to Microsoft Office Excel functions), and references to the values of other cells.</p>
<p>Four elements represent sheets in DatadiagramML: <b class="bterm">DocumentSheet</b>, <b class="bterm">StyleSheet</b>, <b class="bterm">PageSheet</b>, and <b class="bterm">Shape</b>. These elements are shown in the following excerpt from a VDX file:</p><pre><code><VisioDocument>
...
<DocumentSheet>
...
<StyleSheets>
<StyleSheet>
...
<Masters>
<Master>
<PageSheet>
<Shapes>
<Shape>
...
...
<Pages>
<Page>
<PageSheet>
<Shapes>
<Shape>
...
...</code></pre><p> <p><b>Note</b> In practice, the <b class="bterm">Master</b>, <b class="bterm">Shape</b>, <b class="bterm">Page</b>, <b class="bterm">DocumentSheet</b>, <b class="bterm">StyleSheet</b>, and <b class="bterm">PageSheet</b> elements require an <b class="bterm">ID</b> attribute.</p></p>
<p>Consider this fragment of the sheet for a Visio shape as viewed in the ShapeSheet window.</p>
<p><img border="0" src="../img/XML_10.gif" alt="A fragment of a sheet for a Visio shape (the Shape Transform section in the ShapeSheet window)"></p>
<p>The <a target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/DSS_Cells_F-I_1195.asp" id="HV82251195" lcid=" ">Height</a> cell contains the formula '=GUARD(Width)'. <a target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/DSS_Functions_(D-G)_1435.asp" id="HV82251435" lcid=" ">GUARD</a> is a function that protects the formula from being overridden by Visio. The GUARD function takes a single parameter, in this case Width, which is a reference to another cell, the <a target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/DSS_Cells_(T-Z)_1194.asp" id="HV82251194" lcid=" ">Width</a> cell. Defining the Height cell in this way ensures that the shape's width will always be the same as its height.</p>
<p>In DatadiagramML format, the preceding ShapeSheet fragment looks like the following:</p><pre><code><XForm>
<PinX>3.75</PinX>
<PinY>6.75</PinY>
<Width Unit='IN'>6.5</Width>
<Height Unit='IN' F='Guard(Width)'>6.5</Height>
<LocPinX Unit='IN' F='Width*0.5'>3.25</LocPinX>
<LocPinY Unit='IN' F='Height*0.5'>3.25</LocPinY>
<Angle>0</Angle>
<FlipX>0</FlipX>
<FlipY>0</FlipY>
<ResizeMode>0</ResizeMode>
</XForm></code></pre>
<p>The <b class="bterm">XForm</b> element represents the Shape Transform row, which appears as a section in the ShapeSheet window. The child elements<nbsp />— <b class="bterm">PinX</b>, <b class="bterm">Width</b>, and so on, correspond to cells in the row. The <b class="bterm">F</b> attribute contains the cell's formula. The cell's value is the value of the element.</p>
</div>
<p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Elements that represent sheet cells</a></p>
<div id="ExpCol" class="collapsed" border="0">
<p>Elements that represent cells in a sheet contain formulas and values. The element's value specifies the cell formula's last valid computed value. If the last computed value is an error, the element value remains unchanged and an <b class="bterm">Err</b> attribute is added.</p>
<p>Cell elements can have any of the following four optional attributes:</p>
<p><ul>
<li>The <b class="bterm">F</b> attribute, which specifies the formula expression itself. This attribute can contain one of the following strings: "<i>someFormula</i>" if the formula exists locally, "No Formula" if the formula is locally deleted or blocked, or "Inh" if the formula is inherited.<p>If a formula is a simple constant and matches the value of the element, the <b class="bterm">F</b> attribute is optional and may be omitted.</p></li>
<li>The <b class="bterm">Err</b> attribute, which is present if the formula evaluates to an error. The text within the <b class="bterm">Err</b> attribute represents the current value (an error message string); the value of the element is the last valid value, for example: <code><Width F='Height/0' Err='#DIV/0!'>3</Width></code>.<p>For more details on errors than can appear in the <b class="bterm">Err</b> attribute, see <a target="_blank" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/DSS_CTSShapeSheetBasics_1832.asp" id="HV82251832" lcid=" ">About error values</a>.</p></li><li>The <b class="bterm">Unit</b> attribute, which specifies the element's unit of measure. This attribute determines how Visio displays the value, and its value is an enumerated type. For possible values for the <b class="bterm">Unit</b> attribute, see <a href="vixmlconUnitsOfMeasure.htm" id="HV83150825" lcid=" ">Units of Measure</a>.<p>Because each DatadiagramML element has a default unit that Visio uses if the <b class="bterm">Unit</b> attribute is not present, you only need to include a <b class="bterm">Unit</b> attribute if you want to use a unit other than the default. To find out the default unit of a particular element, see that element's topic in this reference.</p><p>The value of a cell element is always expressed in internal units. For example, units that are a measurement of length determine that the values are interpreted as floating point numbers in inches (internal units). If an element has a value of 2 feet, its <b class="bterm">Unit</b> attribute is 'FT' for feet and its value is the number 24.</p><p>Other units, such as date/time, are expressed as formatted strings. In the case of date/time, it is a string like "2000-12-20T23:00:00". For a list of the possible value formats, see <a href="vixmlconUnitsOfMeasure.htm" id="HV83150825" lcid=" ">Units of Measure</a>.</p></li><li>The <b class="bterm">V</b> attribute, which indicates a null string (as opposed to an empty string) in elements whose <b class="bterm">Unit</b> attribute is STR.</li></ul></p>
</div>
<p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Elements that represent sheet rows and sections</a></p>
<div id="ExpCol" class="collapsed" border="0">
<p>In a Visio sheet and in the ShapeSheet window, rows are organized into sections. In the DatadiagramML schema, however, sections are implied (with the exception of Geometry) and rows are immediate children of the root sheet (<b class="bterm">DocumentSheet</b>, <b class="bterm">StyleSheet</b>, <b class="bterm">PageSheet</b>, or <b class="bterm">Shape</b>). (For details on Geometry sections, see <a href="vixmlconWorkingWithGeom.htm" id="HV83150820" lcid=" ">Working with Geometry in DatadiagramML</a>.)</p>
<p>Some elements that represent rows can appear only once in a sheet; others can appear multiple times in a sheet. For instance, a shape's sheet can contain one and only one <b class="bterm">XForm</b> element, but it can contain any number of <b class="bterm">Scratch</b> elements.</p>
<p>Those elements that appear more than once must be identified within the sheet by special attribute tags. Some multirow types are identified by index, and other types are identified by name.</p>
<p><ul>
<li>Indexed elements can have an <b class="bterm">IX</b> attribute with an integer value; the first index is 0, the second 1, and so on. (If the <b class="bterm">IX</b> attribute is not included, Visio automatically assigns the elements in ascending order.)<p> <p><b>Note</b> The <b class="bterm">IX</b> attribute in geometry elements is one-based.</p></p></li>
<li>Named row elements can have a <b class="bterm">Name</b>, <b class="bterm">NameU</b>, or <b class="bterm">ID</b> attribute (or any combination of these attributes) with a string value. Named row elements can appear in any order within a sheet. If the row isn't named, Visio outputs the ID by default and fabricates a name from the ID (for example, for <code>ID='1'</code>, Visio creates <code>Name='Row_1'</code>). If the <b class="bterm">Name</b> and <b class="bterm">NameU</b> string values are identical, Visio outputs only the <b class="bterm">NameU</b> attribute.</li></ul></p>
<p>When Visio emits a DatadiagramML file, elements that represent cells are reordered in the order defined in the schema (and reflected in the tag hierarchy in this reference), but the order that Visio emits elements that represent sheet rows and Geometry sections is arbitrary.</p>
<p><a href="vixmlconSchemaContinued.htm" id="HV83150832" lcid=" ">View the sheet hierarchy</a></p>
</div>
<center><a href="XMLSchemaCopyright_HV01147162.htm">©2003-2004 Microsoft Corporation. All rights reserved.</a>
Permission to copy, display and distribute this document is available at: <a
href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&CTT=11&Origin=HV011232471033"
target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>
|