 |
Sponsored Whitepaper
|
Office 2003 Offers Expanded XML Integration
by Don Kiely
XML is easily the most over-hyped technology of all time, but now that it has had five years to permeate the software industry, it's proving itself a very useful technology in many situations. Microsoft is taking full advantage of the best of XML in its upcoming Microsoft® Office System 2003 productivity suite, which makes Office document formats open to an unprecedented extent and enables some powerful document and custom application-development features.
One of the primary benefits of using XML is that it provides a standard way of separating content, structure, and presentation, and then produces a final document by processing the three definitions. Because it keeps the three aspects of the final document separate, it's easy to swap out pieces so that the resulting document is completely different (see Figure 1). Microsoft leverages this separation throughout Office with its XML implementation to allow new ways of using and manipulating information in custom Office applications. This paper takes a look at some of the baseline XML features in Office, but can only scratch the surface. Microsoft has provided a host of sophisticated ways to use XML in document-based solutions, including capabilities such as smart documents, smart tags, and document protection.
XML Document Schemas
Although XML pervades the Office 2003 suite of applications, Word and Excel embrace it most extensively. Documents in these applications use an XML format as a native storage format, which makes it possible to share documents across applications and platforms. Office just became a first-class content creation tool for any platform!
To make all this work, Microsoft had to create XML schemas to define the structure of an Office document as XML. With a schema, any application can process the document in correct ways. These are complex schemas that completely define every structure, every property, and every option for a Word document and a substantial portion of an Excel workbook. Word is the only one of the major Office 2003 applications where you can alternatively save documents as XML and the binary format with 100 percent fidelity, but enough of the Excel structure is mapped to make it useful for manipulation as XML. For example, here is a small snippet of the Word XML schema that describes the border property:
<xsd:annotation>
<xsd:documentation> BORDER PROPERTY </xsd:documentation>
</xsd:annotation>
<xsd:complexType name="borderProperty">
<xsd:attribute name="val" type="borderValues" use="required">
<xsd:annotation>
<xsd:documentation>Border style</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
…
<xsd:attribute name="frame" type="onOffType" use="optional">
<xsd:annotation>
<xsd:documentation>Don't reverse the border</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
Note that the schema is well-documented with annotations throughout, so that you can be sure what each item describes.
With the Word and Excel XML schemas, you can create Office documents as XML on non-Windows platforms, and Windows users can load the resulting documents directly into the Office 2003 applications. You can still save documents in the proprietary binary formats, or go back and forth between the binary and XML formats. And the schemas open the possibility of scalable server applications that don't require Word or Excel on the server.
Back to top
|