Use the XML Structure pane

A doc template uses XML tags to delimit dynamic sections in the document. Microsoft WordŽ lets you see the XML tags used in an XML Structure pane:

Microsoft Word 2007
  1. On the Developer tab, in the XML group, click Structure.
Microsoft Word 2003
  1. Click View > Task Pane
  2. Select XML Structure in the Task Pane title bar

This pane lists the XML elements used in the document. If you click on an XML element, then this element is selected and revealed in the document. This allows quick navigation in the document.

The bottom pane lists the XML elements that can be applied to the current selection in the document. To add an XML element in the document, you can click on one of these items in this view, or you can right-click Apply XML Element in the document.

Let's change the doc template static contents:

in model : uml21
result.xml
 
Introduction
This document is generated using MDWorkbench.

Note: apply the style Heading 1 to "Introduction".

We will now insert a comment tag in our document. The comment tag enables to insert a description in the doc template that won't be part of the generated document. The contents of the comment is informative and is ignored by the doc template generation engine.

  1. Open the XML Structure pane
  2. Click the XML element comment
  3. Type "This is a comment, not part of the output" between the comment start-tag and end-tag.
  4. Apply the style MDW_Comment to this text

The doc template contents should now be:

in model : uml21
result.xml
 
Introduction
This document is generated using MDWorkbench.
This is a comment, not part of the output

Note that Microsoft WordŽ validates the doc template using the referenced XML schema. This means if you don't type any text inside the comment tag, an error is reported in the XML Structure pane, and you won't be able to save the document in XML:

Related reference
comment tag