Open XML Package Editor Released

Published 22 February 08 08:33 AM | mordonez 

The Visual Studio team has just released a set of add-ons called VSTO Power Tools.  Andrew Whitechapel wrote about it in his blog.  The Power Tools have a treat for Open XML developers, the Open XML Package Editor.

Whether you're writing code or learning the format, you'll want to view the content parts and edit the XML. 

There are several excellent tools that have been available for some time.  I've been using Wouter van Vugt's Package Explorer and Altova's XMLSpy, and both are great. 

Now Open XML Package Editor extends VS with similar capabilities.  VS users now can have fun editing and hacking Open XML. What does it do? 

  • Open any Open XML Package (.docx, .xlsx, .pptx) file or XPS Package file directly in Visual Studio.
  • Browse the package file in a tree view.
  • Open any XML part directly in Visual Studio's rich XML editor.
  • Add and remove parts and relationships with an easy to use UI.
  • Import and export part contents to and from files.
  • Detects when a Package file that is opened in Visual Studio is modified externally.  Prompts user to reload without having to close any open XML part editors.
  • Create new Office Packages from a set of templates using Visual Studio's File > New dialog.

You first notice a tree view of the package contents.  The hierarchy in the tree is based on part URIs (i.e. the physical names given to the parts inside the .ZIP).   The chain link icon represents a relationship to another part.  In this sample you can see that /word/document.xml has a relationship to /media/image1.jpeg. 

One feature I like in Wouter's Package Explorer is the ability to view the OPC package by relationships instead of URI.  That is useful mentally because one of the rules of Open XML programming always navigate by relationship ID, not URI.  In other words, you cannot assume that the start part for WordprocessingML is always called "/word/document.xml".

Editing XML parts

Visual Studio's XML editor works great for editing Open XML parts.  Be sure to download the Ecma-376 XSD schema sets and register them with Visual Studio to enable IntelliSense for XML. 

To add the Open XML schemas to VS:

  1. Open an XML file.
  2. Select the XML | Schema menu.
  3. Add the .xsd's that you unzipped from the Ecma distribution.

Voila!

[update 2008-02-22T08:50 -0800: Fixed a broken link to Andrew's blog, and added a download link to VSTO Power Tools]

Filed under: ,

Comments

# BioSensorAB » Open XML Package Explorer Released said on February 22, 2008 4:00 AM:

PingBack from http://www.biosensorab.org/2008/02/22/open-xml-package-explorer-released/

Anonymous comments are disabled

Search

This Blog

Syndication

Page view tracker