X hits on this document





10 / 47

Microsoft Office 2003 Editions: Overview of Developer TechnologiesSeptember 2004

copy the XML data element by element.

You can save documents that use a custom-defined schema as “data-only” which means that Word saves only the XML data in a file according to the custom schema’s structure. Conversely, you can save documents using the full Word XML schema (WordprocessingML). The WordprocessingML format incorporates all custom XML elements, allowing you to use standard XML techniques against the saved XML file to access and change any of the WordprocessingML or custom XML markup at will.

Word allows you to manage multiple custom schemas on a computer by using the Schema Library. The Schema Library organizes schemas according to namespaces and provides a mechanism to associate transforms (XSLT files) and solutions (smart documents) with a namespace. This allows you to configure Word to process raw XML using a custom default behavior of applying a transform or prompting the user for related solutions.

The custom XML schema support in Word enables you to build powerful solutions using XML to build those solutions more easily and in a way that yields document content that you can easily reuse.

Microsoft Office Excel 2003. Excel with a mapped custom XML schema is still Excel. XML makes it easier to build Excel solutions that aggregate data and provide analytical capabilities. Excel allows you to map the elements of any custom W3C-compliant XML schema within the structure of one or more spreadsheets. Excel also provides a visual data-mapping tool in a task pane (as shown in Figure 2. Unlike the visual inline XML tags that surround words or ranges in a Word document, Excel designates mapped elements with blue, nonprinting cell borders. Excel maps individual elements as defined by the schema to single cells; and maps repeating cells to the new List feature. Although geared toward end-user scenarios, you can access Excel Lists programmatically by using the object model. Lists also offer direct read/write connectivity to lists in Microsoft Windows SharePoint® Services. Excel does not have a capability to work with XML easily that includes repeating elements within other repeating elements.

Figure 2. Custom-defined XML schema mapping in Excel

You can map multiple schemas to a workbook although you cannot map multiple elements to the same cell location. Often you may use one schema to bring in data and another for exporting data. Excel makes it very easy to bring XML data into a schema map, or to export it. If you open an XML file in Excel without a reference to a schema, Excel offers to infer a schema from the XML data and structure. If you save a workbook as SpreadsheetML, Excel saves the map details in the file format and also saves complete copies of the respective schemas.

Excel does not do real-time validation against any attached schemas since with the two-dimensional layout of a spreadsheet it is difficult for you to know where the user last worked. However, you can request a validation at any time in order to notify a user of any errors at specific stages of a solution.

Although Excel doesn’t provide native support for Web services, since the XML map in a worksheet acts like a display transform, it is fairly easy to use code in Microsoft Visual Studio .NET to receive data from a Web service and then use the Excel object model to place the data directly into a map using one method. This is a significant productivity boost from previously available data manipulation techniques.

Microsoft Office InfoPath 2003. A custom XML schema is at the core of every InfoPath form solution. Controls on InfoPath forms map to XML elements defined by the schema, and

© 2006 Microsoft Corporation. All rights reserved. Page 10 By using or providing feedback on these materials, you agree to the attached license agreement.

To comment on this paper or request more documentation on these developer features, contact us at O12Devdx@microsoft.com. We look forward to hearing from you.

Document info
Document views282
Page views283
Page last viewedSat Jan 21 20:28:34 UTC 2017