Formatting Property Values

Most of the children of an <rPr> or <pPr >element have a single @val attribute that is limited to a specific set of values. For example, the <b >(bold) element causes the text that follows it to be bold when the <b >element has a @val attribute with value on. If the @val attribute isn't present for the <b >element, it defaults to "on". Therefore, <w:b/> is equivalent to <w:b w:val="on"/>.

Aside from the default values, which are documented with each element, this is particularly important when specifying the difference between omitting a formatting property and explicitly turning it off.

For example, consider the following run:

<w:r>
  <w:rPr>
    <w:b w:val="off"/>
  </w:rPr>
  <w:t xml:space="preserve">Hello, world. </w:t>
</w:r>

This run explicitly declares that the bold property is turned off for this text, as opposed to the following run:

<w:r>
  <w:t xml:space="preserve">Hello, world. </w:t>
</w:r>

This run says nothing about the bold property. This distinction is particularly important when dealing with content that is formatting using styles - if the content was not contained in a styled paragraph, both would be identical. However, in the case where the paragraph is styled, the former would never be bold regardless of the style information, whereas the latter would express the bold property as set by the style, since it's omission of the bold property means "whatever the underlying formatting is".

Some elements have @val attributes that offer a richer set of choices than on and off; the <u >(underline) element is one such element. In this case, the same rules apply, the omission of the property simply means use the underlying properties.