<contextualSpacing> (Ignore Spacing Above and Below When Using Identical Styles)

This element specifies that any space specified before or after this paragraph, specified using the <spacing> element (§2.3.1.33), should not be applied when the preceding and following paragraphs are of the same paragraph style, affecting the top and bottom spacing respectively.
example: : This value is typically used for paragraphs in lists, in which any space between subsequent list items, even if inherited from another style, is not desirable.

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then spacing is not ignored. If it is present, then the spacing above or below on this paragraph is subtracted from the spacing which would have been present if contextual spacing was off, never going below zero.

example:
<w:p>
  <w:pPr>
    <w:pStyle w:val="TestParagraphStyle" />
    <w:spacing w:after="200"/>
    <w:contextualSpacing/>
  </w:pPr></w:p>
<w:p>
  <w:pPr>
    <w:pStyle w:val="TestParagraphStyle" />
    <w:spacing w:before="240"/>
  </w:pPr></w:p>

The first paragraph specifies a spacing @after of 10 points, and the second paragraph specifies a spacing @before of 12 points, therefore according to the rules on the <spacing> element, the net paragraph spacing should be 12 points. However, since the first paragraph specifies that its spacing should be omitted between paragraphs of the same style, and the two paragraphs use the same TestParagraphStyle, that value is subtracted from the total, therefore the paragraphs are spaced by 2 points. ]

Parent Elements

<pPr>2.7.4.2); <pPr>2.9.24); <pPr>2.3.1.25); <pPr>2.7.5.1); <pPr>2.3.1.26); <pPr>2.7.7.2)

Attributes

Description

<val> (On/Off Value)

Specifies a binary value for the property defined by the parent XML element.

A value of on, 1, or true specifies that the property shall be explicitly applied. This is the default value for this attribute, and is implied when the parent element is present, but this attribute is omitted.

A value of off, 0, or false specifies that the property shall be explicitly turned off.

<w:… w:val="off"/>

The @val attribute explicitly declares that the property is turned off. ]

The possible values for this attribute are defined by the ST_OnOff simple type (§2.18.67).

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_OnOff">
	<attribute name="val" type="ST_OnOff"/>
</complexType>