Section 14.4.  XML expansion packs and manifests

Prev don't be afraid of buying books Next

14.4. XML expansion packs and manifests

An XML expansion pack is a group of related files that make up one or more related Office XML solutions. It may include schemas, XSLT stylesheets, smart tag lists, DLLs for smart documents, external files used in smart document solutions, and other types of files.

Each XML expansion pack contains a manifest: an XML document that lists all of the files in the pack, their "types" (i.e. their roles in an Office solution, such as solutionActionHandler), and their locations. In 14.1.2, "Installing a smart document solution", on page 322, we installed a smart document solution using the manifest shown in Example 14-14.

Example 14-14. Manifest for the smart document solution (letter_manifest.xml)
 <?xml version="1.0" encoding="UTF-8"?> <manifest xmlns= "http://schemas.microsoft.com/office/xmlexpansionpacks/2003">   <version>1.1</version>   <updateFrequency>20160</updateFrequency>   <uri>http://xmlinoffice.com/letter</uri>   <solution>     <solutionID>{15960625-1612-46AB-877C-BBCB59503FCF}</solutionID>     <type>smartDocument</type>     <alias lc>Letter Smart Document Sample</alias>     <file>       <type>solutionActionHandler</type>       <version>1.0</version>       <filePath>LetterSample.dll</filePath>       <CLSID>{F854ADAA-A8A2-40EC-B31A-A2DB811FD7F3}</CLSID>     </file>   </solution>   <solution>     <solutionID>schema</solutionID>     <type>schema</type>     <alias lc>letter</alias>     <file>       <type>schema</type>       <version>1.0</version>       <filePath>letter.xsd</filePath>     </file>   </solution> </manifest> 

  • The manifest element defines the namespace for the manifest document.

  • The uri element contains the target namespace for the solutions.

  • The first solution element describes a solution whose type is smartDocument. It uses the file LetterSample.dll, whose type is solutionActionHandler. The alias element's content is the name that appears in the XML Expansion Pack dialog.

  • The second solution element describes a solution whose type is schema. It uses the file letter.xsd – whose type is also schema – as its schema document. (Other valid values of type for files are transform and other.) The alias element's content is used in the Schema Library as a nickname for the schema.

Other element types may be included in a manifest; a detailed reference is provided in the Smart Documents SDK.

When this expansion pack is installed, both the smart document solution and the schema are added to the library locally.

When an expansion pack is associated with a document, a link to the manifest is stored within the document's metadata, which allows the solution to be centrally maintained. The manifest can be stored on a file server or in SharePoint, or even be returned by a Web service. To upgrade to the latest version of a solution, a user can select it and click Update in the XML Expansion Packs dialog.

Alternatively, a solution can be set up for automatic installations and updates. If a user who does not have the latest version of an expansion pack installed tries to open an associated document, he will be prompted to allow the expansion pack to be installed automatically. This approach greatly simplifies deployment of changes and upgrades to solutions.

XML expansion packs are not just for smart documents. They can be used simply to add schemas and stylesheets to Word documents, rather than requiring that users do this manually. XML expansion packs can also be used in Excel, by clicking XML Expansion Packs on the XML submenu.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net