Publishing Content to the Web via XSLT Transformations

The XML integration provided in Word opens up many powerful and exciting capabilities for information sharing and distribution. These capabilities can be leveraged by using XSLT transformations to put the data in a form suitable for display on the Web.

Viewing through the Web would be a pretty boring experience if not for the ability to use colors, fonts, graphics, and layout to present the information in an attractive and interesting way. To support the expectations of viewing on the Web, the Word document attributes must be transformed into the corresponding HTML equivalents. Accomplishing this feat, however, is not a trivial task. You'll need to develop an understanding of XSLT style sheets, as well as how to translate the WordML schema into equivalent HTML formatting elements.

Extensive documentation on the WordML schema and its object model for representing a document is readily available, but much can be learned by some simple examination of the generated XML of the Word document. For most applications for transforming data to the Web, the number of different attributes that are needed is a small subset of the overall Word document object model.

You can follow these steps to learn a lot about the WordML schema:

  1. Start with an empty Word document, and then enter a small amount of text and apply a single attribute of interest to it (like bold).

  2. Save the document as an XML document.

  3. Open the document in Notepad and remove the second line from the file that looks like <?mso-application progid="Word.Document"?>.

  4. After saving these changes, double-click on the file and it will be displayed in Internet Explorer.

  5. Locate the <w:body> root that represents the contents of the document.

  6. Examine the contents of that element to learn which elements control the specific behavior desired.

    Part I: Word Basics: Get Productive Fast
    Part II: Building Slicker Documents Faster
    Part III: The Visual Word: Making Documents Look Great
    Part IV: Industrial-Strength Document Production Techniques
    Part VI: The Corporate Word