Microsoft Office 2003 XML Viewer [Word 2003 XML Reference] --  Microsoft Office Word 2003 XML Software Development Kit

Microsoft Office 2003 XML Viewer [Word 2003 XML Reference]

The Microsoft© Office 2003 XML viewer supports the display of the following XML files inside Internet Explorer:

  • Wordprocessing Markup Language (WordProcessingML) files, which are Microsoft Office Word 2003 files saved as XML files. They are identified by the Office Word 2003 processing instruction (PI):

    <?mso-application progid="Word.Document"?>

  • Other XML files that contain the msoxml PI:

    <?mso-application progid="Msoxml.Document"?>

Once you opened an XML file with one of the above PIs in Internet Explorer, you can add views (XSLT transformations) that affect how your file displays. You can also delete, modify, and switch between views.

Note  Throughout this topic, instructions to open an XML file assume the file contains one of the two PIs listed above.

Adding views.

Adding views in Internet Explorer.

  1. Open an XML file inside Internet Explorer.
  2. Right-click inside Internet Explorer.
  3. Select Add New View...
  4. In the View Settings dialog, either type the location of your XSL Transformation inside the Location text box, or use Browse... to locate your .XSL file.
  5. Type a user friendly name in the Alias text box. This name is displayed in the tab for the view at the bottom of Internet Explorer. If it is left blank, then the full path of the transform appears in the tab.
  6. Clear the Changes affect current user only box if you want the new view available to all users of your computer.
  7. Click OK. The view is added to the tab control at the bottom of Internet Explorer and applied to your XML file upon clicking OK.

Adding views programmatically using the registry.

Views used by the XML Viewer are stored in the Schema Library. The following information is useful for programmatically adding views to the Schema Library inside the registry.

Caution  Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

  • A view affects either the local computer or the current user. For the local computer the key is under HKEY_LOCAL_MACHINE and for the current user it is under HKEY_CURRENT_USER. Each view is assigned a unique GUID. This GUID is the name of the view's key inside the Schema Library and it is located under the root for Microsoft's Schema Library. For example, the default WordML to HTML view installed by the viewer is located in the following location:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Schema Library\http://schemas.microsoft.com/office/word/2003/wordml\0\Solutions\http://schemas.microsoft.com/office/word/2003/viewer\0\{A3AB2AF9-8C4D-4CA5-906B-2E23E620C534}

    Whether the view is installed for the local computer or current user corresponds directly with the Changes affect current user only checkbox in the View Settings dialog.

  • The view's alias is located in the value of an item named for the user's locale (e.g. 1033 for U.S. English). This item is located in a subkey of the view called Alias.

  • The view's full path, including its file name, is located in the value of an item named Location which is in the view's key.

  • To prevent accidental deletion and modification of a view by disabling the Delete View and View Settings... items on the right-mouse menu, add a string value named guard under the view's key. Only the existence of the guard key is required. Its data does not make a difference and can be left empty. If you want to re-enable these two right-mouse menu items on a view, delete the guard key.

Adding the Internet Explorer Tree View.

When the Microsoft Office 2003 XML Viewer is not installed, Internet Explorer typically displays XML files in a collapsible tree view. This tree view is still available with the XML Viewer installed, but is not added to the available views upon installation. To add it, use the Add New View... right-mouse menu option:

  1. Open an XML file inside Internet Explorer.
  2. Right-click inside Internet Explorer.
  3. Select Add New View...
  4. In the View Settings dialog, either type the location of defaultss.xsl inside the Location text box, or use Browse... to locate it. The defaultss.xsl file is inside the folder in which the XML Viewer is installed.
  5. Type a user friendly name in the Alias text box.
  6. Clear the Changes affect current user only box if you want the new view available to all users of your computer.
  7. Click OK.

Switching views.

  1. Open an XML file inside Internet Explorer.
  2. Choose from one of the following two methods.
    • Right-click inside Internet Explorer and choose the desired view from the bottom of the right-mouse menu.

    • Select the view from the tab control at the bottom of the Internet Explorer that you want to set as the default.

      Note  If only one view is installed, then the tab control at the bottom of the Internet Explorer does not display.

Setting a view as the default view.

  1. Switch to the view that you want to set as the default.
  2. Right-click inside Internet Explorer and click Set as Default View.

Deleting a view.

  1. Switch to the view from that you want to delete.
  2. Right-click inside Internet Explorer and click Delete View.

Note  If the guard value is present under a view's registry key, then Delete View and View Setting... are disabled from the Internet Explorer's right-mouse menu when that view is selected. For more information, see Adding views programmatically using the registry under Adding views in this topic.

©2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp