When Word opens an arbitrary XML document (i.e., an XML document that is not WordprocessingML), that XML document undergoes four primary processes from the time that it is opened to the time that it is saved, in this order:
When the document is first opened, an
onloadXSLT stylesheet (variously called an “XML data view” or “solution” in the Word UI) is applied, transforming the raw XML into a WordprocessingML document, usually intermixed, or merged, with custom XML tags from the original document.
A user edits the document, modifying the underlying merged representation.
This basic flow is illustrated in the data flow diagram in Figure 4-7.
Each arrow in Figure 4-7 represents an XML document in different states of transformation. Each process operates on the result of the previous process. The last two processes, “Save data only” and “Apply custom transform,” are both optional. When an option is not elected, you can think of the process as being an identity transform, or a no-op. For example, if “Save data only” is turned off, but “Apply transform” is turned on, then the latter effectively operates on the result of process # 2, “User edits document.”
In the next several sections of this chapter, we will detail each of
these processes, including how the
stylesheet is selected, what the merged representation looks like,
what editing functionality is available to the user, how the
“Save data only” option works and
how to set it, and how an
XSLT transformation is selected. But
first let’s take a look at the Schema Library, an
important ingredient not explicitly evident in this
diagram—important because it is consulted both to determine
onload XSLT transformation to apply, and to
enable on-the-fly schema validation while editing the