Reviewing the XML-Specific Document Options

So far, we’ve introduced a number of different XML-related document options in various contexts. Now let’s take a look at them together, including some new ones. You can configure most of these through the XML Options dialog. Figure 4-22 shows the XML Options dialog with the default XML settings. To open this dialog, select Tools Templates and Add-Ins XML Schema XML Options.

The XML Options dialog

Figure 4-22. The XML Options dialog

The options in Figure 4-22 correspond to these elements in WordprocessingML:

  1. w:removeWordSchemaOnSave —When enabled, Word removes all Word-specific markup from the document when saving.

  2. w:useXSLTWhenSaving —When enabled, Word applies an XSLT stylesheet to the document when saving.

  3. w:saveThroughXSLT —When the “Apply custom transform” option is on, this element’s w:xslt attribute determines what stylesheet will be applied.

  4. w:validateAgainstSchema —When enabled, Word validates the document while the user is editing it. This option is turned on by default unless explicitly turned off.

  5. w:doNotUnderlineInvalidXML —When enabled, Word does not display validation errors in the document being edited.

  6. w:ignoreMixedContent —When checked, Word strips out mixed content text for the purpose of validation, as well as for the purpose of saving (when the “Save data only” option is on).

  7. w:saveInvalidXML —When checked, Word will not disallow the user from saving a document as XML even though the embedded XML document is invalid according to its schema.

  8. w:alwaysShowPlaceholderText —When checked, Word automatically displays the name of each empty leaf element as placeholder text when “Show XML tags” is turned off, and when the element does not explicitly specify its own placeholder text.

Except for the w:saveThroughXSLT element, all of these options are Boolean options. Each of their corresponding elements is defined in the WordprocessingML schema to use the onOffProperty type, which means that it is an empty element and that it has a w:val attribute whose value can be either on or off. When the element is present but the attribute is absent, then it defaults to on.

The other two checkboxes listed under “XML view options” in Figure 4-22 are not document-specific options and so do not have a WordprocessingML representation.

Get Office 2003 XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.