Visio 2007 and XML File Formats

Since the 2002 edition, Visio has supported Extensible Markup Language (XML) file formats. XML goes beyond HTML in describing file content and has quickly become a new standard for Web-based data. In Visio 2007, the .vdx (drawing file), .vsx (stencil file), and .vtx (template file) extensions are the XML equivalents of .vsd, .vss, and .vst. You can export and import Visio 2007 files in XML format by using the standard Save As and Open commands on the File menu, as Figure 21-7 shows. In the Save As or Open dialog box, choose the appropriate XML format in the Save As Type or Files Of Type list.

Figure 21-7. In the Save As dialog box, the XML file formats appear in the Save As Type list.


For most users, the XML interface is not particularly useful. “They’d best avoid it,” is how one senior Visio programmer put it. Saving a drawing file in XML format expands the file size approximately eight times. So why is it there? XML is useful to organizations that want to incorporate the contents of Visio 2007 files into enterprise systems that exchange information in this format. For example, you can create a Visio 2007 flowchart that shows a business process, export the flowchart in XML format, and then share it with other businesses using the Microsoft BizTalk server. You can save drawings as well as customized stencils or templates in an XML format.

Opening XML Files

When a Visio 2007 file is saved in XML format, you can open it in Visio 2007 and work with it in all the ways you can work with standard Visio 2007 drawing, stencil, and template files. Visio 2007 can open any file that contains well-formed XML code that complies with the Visio 2007 XML schema and the internal rules for Visio 2007. You can also open the XML files that Visio 2007 creates in a text or code editor. Visio 2007 includes a tag for just about every Visio 2007 attribute, from line jump behavior to color definitions. If you’re familiar with XML tags and Visio 2007 commands, you can easily recognize most of the tags that Visio 2007 creates.

Inside Out: XML interface documentation

Microsoft has released several documents discussing the XML interface in Visio 2007. More information is available at http://msdn2.microsoft.com/en-us/library/ms426602.aspx


Making XML the Default File Format

You can make XML the default Visio 2007 drawing format. To do this, choose Tools, Options, and then click the Save/Open tab, as Figure 21-8 shows. Select Visio XML Document from the Save Visio Files As list on the Save tab. In the same dialog box, you can specify whether you want Visio 2007 to display warnings and error messages when it opens XML files that contain information it cannot recognize or when it saves XML files that contain data other programs might not be able to read.

Figure 21-8. You can specify XML as the default file format for Visio 2007 documents by choosing Tools, Options.


Inside Out: Saving as HTML versus XML

If you want to use a Visio 2007 diagram as a Web page, it’s better to save it as an HTML file than an XML file. If you post a Visio 2007 page in XML format on a Web site, visitors to the site can view the XML file if they have Visio 2002, Visio 2003, or Visio 2007 installed on their systems. In addition, if they can see the file, they can also edit it. If you post an HTML file, you can offer viewers a large amount of data without risking the integrity of your drawing.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset